=== Ghost Quiz Master Pro ===
Contributors: sghoshnbu
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A complete quiz and examination suite: eleven question types, manual grading, certificates, exam integrity, printable papers, Moodle interchange.

== Renamed in 1.8.0 ==

The plugin's storage layer (post types, taxonomy, post/user meta keys, options, and the results table) is now renamed from the legacy `qmc_` prefix to `gqmp_`, matching the presentation-layer rename already done in 1.7.0. Earlier versions deliberately left storage untouched to avoid a migration; this version adds that migration instead, since a distinct, sufficiently-long prefix throughout is expected of a directory-hosted plugin.

**No action is needed and no data is lost.** On the first admin page load after updating, the plugin runs a one-time, automatic migration that moves any existing quizzes, questions, categories, results, badges and settings from the old `qmc_` names to the new `gqmp_` ones. The migration is idempotent and safe to run on a fresh install (where it simply does nothing).

Shortcodes already published in your content keep working either way: the older `[qmc_quiz]`, `[qmc_leaderboard]`, `[qmc_user_points]`, `[qmc_user_dashboard]` and `[qmc_attempt_review]` shortcodes remain registered alongside the current `[gqmp_*]` ones, and the old Gutenberg block name stays registered too — shortcode tags are independent of the underlying post type/meta rename, so there's nothing to update in your pages.

== Renamed in 1.7.0 ==

The plugin is now **Ghost Quiz Master Pro** (it was Quizzis For All, and before that Quiz Master Core). This rename covered the plugin name, slug, text domain, class names, constants and file names, and the REST namespace. At the time, the storage layer was deliberately left on its older naming (see "Renamed in 1.8.0" above for why that's since changed).

== Renamed in 1.6.0 ==

The plugin was previously renamed from Quiz Master Core to Quizzis For All, for the same reason: the plugin name, text domain, class names and file names were updated, while everything the plugin stores kept its original naming at the time.

== What's new in Phase 6 (1.5.0) ==

* **Student attempt review** — students can now open any past attempt from their dashboard and see each question, the answer they gave, the correct answer, instructor feedback and explanations. Access is strict: only the logged-in owner of an attempt can view it. A new per-quiz **Student Review** policy controls what is released — full review, full review only once graded, their own answers without the answer key, or no review at all — so exam papers don't leak answer keys between cohorts. Also available standalone via `[gqmp_attempt_review]`.
* **Exam integrity pack** (per quiz, all opt-in): copy/right-click protection on question text (answer fields stay usable), tab-switch warnings with an optional auto-submit threshold, a server-side honeypot, a minimum-duration check, one-attempt-in-flight enforcement across tabs and devices, and an event log surfaced as an advisory flag on the grading screen. These raise the cost of casual cheating and record signals for review — they are not proctoring, and the plugin says so plainly in the admin UI.
* **Printable paper mode** — render any quiz as a print-ready question paper (masthead, time/marks line, candidate name-roll-date fields, instructions box, per-question mark allocations, OMR-style option boxes, ruled answer space for essays, shuffled matching columns) and, separately, a marked **answer key** with correct answers and explanations. Both link from the quiz editor's publish box and print cleanly to A4 or PDF.

== What's new in Phase 5 (1.4.0) ==

* **Redesigned admin dashboard** — gradient hero, live stat tiles (quizzes, bank size, attempts, grading queue, average score & pass rate), recent-attempts and quiz-performance panels, and a quick-links row. Styled admin CSS now applies across every Quiz Master screen.
* **Manual grading UI** — the missing half of essay and file-upload questions. A dedicated **Grading** queue (with a pending count badge in the menu) lists every attempt awaiting review; open one to read each answer, download uploaded files, award points against the question's maximum, and leave per-question feedback. Saving recomputes the score, percentage and pass/fail, issues a certificate if the new score crosses the pass mark, and can email the test-taker their final result. Re-grading is safe — previous manual points are backed out rather than compounded.
* **Attempt review screen** — the same screen doubles as a read-only review of *any* attempt (every question, the answer given, correct/incorrect), reachable from the Results table.
* **GIFT import/export** — Moodle's plain-text format: multiple choice, true/false, short answer, numerical (point and range tolerance) and matching, including `::title::` prefixes, escapes and `%50%` weighted answers.
* **CSV import/export** — author questions in Excel or Google Sheets and round-trip them; per-row categories are created automatically on import.
* **Moodle XML import/export** — the format Moodle itself exports, so a question bank can move between Moodle and WordPress in either direction (multichoice, truefalse, shortanswer, numerical, matching, essay). XML parsing runs with external entities disabled.

== What's new in Phase 4 (1.3.0) ==

* **Complete visual redesign** — design-token driven CSS: card-based questions with custom-drawn radio/checkbox controls, animated progress bar and results, sticky pill timer, polished popup modal, automatic **dark mode** (prefers-color-scheme), reduced-motion support, and mobile refinements.
* **Per-quiz accent color** — a color picker in Quiz Settings re-themes buttons, progress, highlights, and selection states for that quiz only.
* **Category-selective dynamic quizzes** — instead of a fixed question list, a quiz can draw N random questions from chosen question-bank categories on every attempt, so no two attempts see the same paper. Grading validates the served set server-side.
* **Gutenberg block** — a "Quiz" block (build-free, server-rendered through the same pipeline as the shortcode) with a quiz picker in the editor.
* **Classic widget** — embed any quiz in sidebar/footer widget areas.
* **Admin dashboard widget** — quizzes/questions/attempts at a glance plus the five latest attempts, right on the WP dashboard.
* **REST API (read-only)** — `GET /wp-json/gqmp/v1/quizzes` and `GET /wp-json/gqmp/v1/leaderboard?quiz_id=&limit=` expose the same public data the shortcodes render, for headless or JS use. No keys, no external services.

== What's new in Phase 3 (1.2.0) ==

* **Save & resume** — logged-in users can leave a quiz mid-way and pick up where they left off (autosaves every 20s and on navigation/page-exit); toggle per quiz.
* **User dashboard** — `[gqmp_user_dashboard]` shortcode: in-progress quizzes with resume links, full completed-quiz history, certificate links, and points/badges.
* **Quiz types**:
  - *Personality* mode — tag radio/checkbox options with a "trait" key, define outcomes (title + description) in the new Personality Outcomes box, and the result screen shows the matching outcome instead of a score.
  - *Chained* — set a "prerequisite quiz"; the plugin blocks access until it's passed, and automatically shows a "Next quiz →" link on the prerequisite's results once passed.
  - *Popup* — a per-quiz "Show as popup" toggle turns the shortcode into a button that opens the quiz in a modal instead of rendering inline.
* **Certificates** — opt in per quiz; passing generates a unique, printable HTML certificate (browser "Print → Save as PDF" for a PDF copy) with the recipient's name, score, date, and an optional signee line.
* **Email notifications** — opt in per quiz to email the test-taker their result (with a certificate link if issued) and/or notify the admin of new attempts.
* **H5P integration** — set an H5P content ID on a quiz to embed that interactive content (e.g. a video or presentation) above the quiz intro, if the H5P plugin is active.

== What's new in Phase 2 (1.1.0) ==

* **Matching** question type — left items matched to shuffled right items via dropdowns.
* **File Upload** question type — student uploads a file (extension + size limits you set); stored as a media library attachment and flagged for manual grading.
* **Gamification** — points (best score per quiz, summed — retaking never inflates), five starter badges, `[gqmp_leaderboard]` and `[gqmp_user_points]` shortcodes, and a Gamification settings page with an on/off switch.
* **Reporting dashboards** (Quiz Master → Reports) — overview cards (attempts, average score, pass rate, unique test-takers), a 30-day attempts trend chart, per-quiz performance table, and a per-question difficulty breakdown (with chart) so you can see which questions are miscalibrated.
* Quiz submission now uses `FormData` under the hood so file-upload answers travel in the same request as everything else; a `question_breakdown` column was added to the attempts table (auto-migrated on next admin page load) to power the new reports without re-grading old data.

== What's in Phase 1 ==

* Unlimited quizzes and unlimited questions (no artificial caps anywhere).
* A reusable **question bank** — build a question once, use it in any number of quizzes.
* Question types: Radio (single choice), Checkbox (multiple choice), True/False,
  Short Text, Text/Essay (manual grading), Number (with tolerance), Date,
  Fill in the Blanks, and Info Banner (non-scored instructional slide).
* Quiz settings: timer, pass mark, max attempts per user, question/answer
  randomization, questions-per-page pagination, live progress bar, hints,
  right/wrong messages with per-question explanations, require-login option.
* Frontend rendering via `[gqmp_quiz id="123"]` shortcode — AJAX submission,
  no page reload, keyboard navigation (number keys select options, Enter
  advances), mobile-friendly.
* Results stored in a dedicated database table (not post meta) for fast
  reporting; CSV export from Results & Reports screen.
* **Aiken format import/export** — bulk-import questions from a plain-text
  .txt file (the format Moodle and many item banks use), and export a
  quiz's single-choice / true-false questions back out to Aiken.

== Installation ==

1. Zip the `ghost-quiz-master-pro` folder (or upload as-is) to `wp-content/plugins/`.
2. Activate **Ghost Quiz Master Pro** from the Plugins screen.
3. Go to **Quiz Master → + New Question** to build your question bank, or
   **Quiz Master → Import (Aiken)** to bulk-import from a .txt file.
4. Go to **Quiz Master → + New Quiz**, add questions from the bank, configure
   settings, and copy the shortcode into any page or post.

== Aiken format ==

	What is the capital of France?
	A. London
	B. Paris
	C. Berlin
	D. Madrid
	ANSWER: B

Separate each question block with a blank line.

== Roadmap (not yet built) ==

Category-selective quiz shortcodes, quiz types not yet covered (paid,
scored-vs-timed variants beyond the current set), and third-party
integrations (payment gateways, email marketing platforms, page builders,
AI providers, Zapier, etc.) are intentionally left for later phases —
most need API credentials and per-integration decisions that are best
handled one at a time.

== Changelog ==

= 1.8.0 =
* Renamed the storage layer's `qmc_` prefix to `gqmp_` (post types, taxonomy, post/user meta keys, options, results table), completing the rename started in 1.7.0. A one-time automatic migration moves existing data over on update; see "Renamed in 1.8.0" above.

= 1.7.0 =
* Renamed the plugin to Ghost Quiz Master Pro (previously Quizzis For All) following a WordPress.org plugin-name/trademark review; slug, text domain, class names, constants, REST namespace and file names updated accordingly. At the time, stored data (post types, taxonomy, meta keys, options, results table) was left untouched; that changed in 1.8.0.
* Set the Plugin URI to https://saptarshi.in/wpplugins/ghost-quiz-master-pro.
* Converted the inline `<script>` blocks on the Reports admin page and the Personality Outcomes meta box to properly registered/enqueued scripts using `wp_add_inline_script()`.
* Removed the deprecated `libxml_disable_entity_loader()` calls from the Moodle XML importer; external entity loading has been disabled by default in libxml2/PHP since well before the plugin's minimum supported PHP version, and `LIBXML_NONET` plus internal-error handling remain in place.
* Updated the bundled Chart.js library from 4.4.0 to 4.5.1.
* Reviewed all `register_rest_route()` calls; the two public, read-only endpoints intentionally use `__return_true` as their `permission_callback` (documented inline) since they expose the same data already public via shortcodes.

= 1.6.0 =
* See "Renamed in 1.6.0" above.
