=== HEXAM — Quiz & Exam Builder ===
Contributors: elvinhaci
Tags: quiz, exam, test, assessment, quiz builder
Requires at least: 6.2
Tested up to: 7.0.1
Requires PHP: 7.4
Stable tag: 2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create modern quizzes and exams in WordPress. Drag-and-drop builder, multiple question types, scheduling, enrolment, stats, and CSV import.

== Description ==

**HEXAM** is a fast, secure and modern quiz and exam plugin for WordPress. Build engaging quizzes, graded exams, knowledge checks, surveys and online assessments in minutes — then drop them into any page or post with a block or shortcode. Whether you run an e-learning site, a membership community, a school or a corporate training portal, HEXAM gives you a professional quiz experience with zero configuration headaches.

Version 2.0 is a complete, ground-up rewrite: a beautiful mobile-friendly frontend, a drag-and-drop question builder, real question types, scheduling, enrolment control, live scoring and per-quiz statistics — all following current WordPress security and coding best practices.

= Why choose HEXAM? =

* **Modern quiz UI/UX** — clean, responsive, accessible quizzes that look great on any device and adapt to light or dark mode.
* **Drag-and-drop quiz builder** — reorder questions by dragging, add or remove answers instantly, no page reloads.
* **Real question types** — single choice (radio), multiple choice (checkboxes) and open text answers.
* **Two display modes** — show every question in one list, or present them one-by-one as slides with a progress bar.
* **Scheduling** — set a start date (with a friendly "not started yet" notice) and a deadline for each quiz.
* **Enrolment control** — make a quiz public, restrict it to specific user roles, or limit it to named individual users.
* **Automatic scoring** — instant grading with an optional passing percentage, pass/fail messaging and a score meter.
* **Negative marking (penalty for wrong answers)** — optionally deduct a configurable percentage of a question's points for each wrong answer (default 25%), just like real certification and competitive exams. Unanswered questions are never penalised, so guessing carries a genuine risk.
* **Statistics dashboard** — attempts, average score, best score, pass counts and every individual submission per quiz.
* **Images in questions & answers** — insert pictures straight from the WordPress media library into any question or answer option, with a live preview while you build.
* **Gutenberg block + shortcode** — insert any quiz with the "Hexam Quiz" block or the classic `[hexam id=1]` shortcode.
* **CSV import with column mapping** — bulk-create quizzes from a spreadsheet and map your own column names.
* **Fully translatable (i18n)** — every string is translation-ready, and every on-screen message is customisable per quiz.
* **Secure by design** — nonces, capability checks, prepared statements, and full input sanitisation / output escaping throughout.
* **Safe upgrades** — existing 1.x installs are automatically migrated to the new database structure on activation.

= Perfect for =

* Online courses and e-learning (LMS-style knowledge checks)
* Schools, teachers and students
* Employee training and onboarding assessments
* Membership sites and communities
* Lead-generation quizzes and marketing
* Certification and practice exams

== Coming soon ==

We are actively building the next generation of HEXAM. On the roadmap:

* **Payment paywalls** — sell access to premium quizzes and certification exams, with per-quiz pricing and coupons.
* **Certificates** — auto-issue downloadable PDF certificates when a learner passes.
* **Question banks & randomisation** — draw a random subset of questions per attempt.
* **Timed exams** — countdown timers with auto-submit.
* **Detailed analytics & CSV export** — per-question breakdowns and exportable reports.

== Installation ==

1. Upload the `hexam` folder to `/wp-content/plugins/`, or install it from the Plugins screen.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Two example quizzes are created automatically so you can see how everything works.
4. Open **Hexam → Getting started** for a quick guided tour.
5. Create a quiz under **Hexam → Add New**, then add the **Hexam Quiz** block (or the `[hexam id=1]` shortcode) to any page or post.

== Frequently Asked Questions ==

= How do I add a quiz to a page? =
Use the "Hexam Quiz" block in the editor and pick your quiz, or paste the shortcode `[hexam id=1]` where `1` is the quiz ID shown in the quiz list.

= What question types are supported? =
Single choice (one correct answer), multiple choice (several correct answers) and open text answers that are graded against accepted values.

= Can I restrict who takes a quiz? =
Yes. Each quiz can be public, limited to chosen user roles, or restricted to specific users.

= Can I schedule a quiz? =
Yes. Set an optional start date and deadline. Before the start date visitors see a "not started" notice; after the deadline the quiz is closed.

= Does HEXAM support negative marking? =
Yes. Enable "negative marking" on any quiz to deduct a configurable percentage of a question's points (default 25%) for each wrong answer — ideal for certification, entrance and competitive exams where guessing should be discouraged. Unanswered questions are never penalised, and multiple-choice questions can be graded as all-or-nothing or with partial credit.

= Will my old HEXAM 1.x quizzes still work? =
Yes. On activation, your existing quizzes, questions and results are automatically migrated to the new structure, and the legacy `[hexam id=1 hexam]` shortcode keeps working.

= Can I bulk import questions? =
Yes. Use **Hexam → Import CSV**, map your columns, and a draft quiz is created for review.

= Is my data removed when I delete the plugin? =
Only if you opt in under **Hexam → Settings**. By default your quizzes are preserved in case you reinstall.

== Screenshots ==

1. The modern, responsive quiz frontend.
2. The drag-and-drop quiz builder.
3. Per-quiz statistics dashboard.

== Changelog ==

= 2.0.0 =
* New: negative marking — optionally deduct a configurable percentage (default 25%) of a question's points for each wrong answer; unanswered questions are never penalised.
* New: two multiple-choice grading modes — all-or-nothing (full match) and partial credit (every correct pick counts).
* New: insert images from the media library into questions and answer options, with a live preview in the builder.
* New: clone/duplicate a quiz (settings and questions only; submissions are not copied).
* Fractional scoring support for partial credit and penalties.
* Complete rewrite following modern WordPress best practices.
* New drag-and-drop quiz builder with single / multiple / open question types.
* Redesigned, responsive, accessible frontend with list and one-by-one slide modes.
* Per-quiz scheduling (start date and deadline).
* Enrolment control: public, role-based or user-based access.
* Automatic scoring with optional passing score and customisable messages.
* Statistics dashboard per quiz.
* Gutenberg "Hexam Quiz" block plus the classic shortcode.
* CSV import with flexible column mapping.
* Full internationalisation of all strings.
* New normalised database schema with automatic migration from 1.x.
* Security hardening throughout (nonces, capability checks, prepared statements, sanitisation and escaping).

= 1.3 =
* Some bugfixes, code optimizations.

== Upgrade Notice ==

= 2.0.0 =
Major update and full rewrite. Your existing quizzes and results are migrated automatically on activation. Back up your database first, as with any major upgrade.
