=== Toolkit for LearnDash LMS - Quiz Themes, Analytics & Answer Control ===
Contributors: fahadmahmood, invoicepress
Donate link: https://www.androidbubbles.com/contact
Tags: learndash, quiz, lms, analytics, elearning
Requires at least: 5.8
Tested up to: 7.1
Stable tag: 2.2.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Modern quiz themes, quick-start wizard, analytics with CSV export, Elementor widget and Gutenberg block, progress bar and friendly results for LearnDash.

== Description ==

**Toolkit for LearnDash LMS** is a lightweight add-on that makes LearnDash quizzes look better, behave better and tell you more. It does not replace LearnDash and never modifies LearnDash files.

= Themes and design =
* Five themes: Default, Standard, Flipper, **Modern** and **Dark**.
* **Colour and type editor** with live preview: primary, correct and incorrect colours, corner radius, text size and font family.
* **Per-quiz theme override** from the quiz edit screen.
* Responsive, keyboard-focus-visible and reduced-motion friendly.
* Register your own theme with the `tkflld_skins` filter.

= Better quiz experience =
* **Progress bar** ("Question 3 of 10") while learners take a quiz.
* **Enter key** in a fill-in-the-blank field moves to the next question.
* **Case sensitivity** for fill-in-the-blank answers (uses LearnDash's own filter).
* **Show correct answers exactly as typed** in the editor on the View Questions screen. Supports `{answer}` and `{[answer one][answer two]}` syntax.
* Hide the title, breadcrumbs, post meta, Start / Back / Next / Restart / View Questions / Continue / Print Certificate buttons and the results heading.

= Easy setup =
* **Quick start** screen: pick "Friendly practice", "Strict exam" or "Clean and minimal", a theme and your brand colour, and you are done.
* **Health** tab checks LearnDash, statistics, caching plugins and PHP.
* Dashboard widget with the last 7 days of quiz activity.

= Analytics =
* Per-quiz overview: attempts, learners and correct-answer rate, with 7 / 30 / 90 day and all-time ranges and an attempts-per-day chart.
* Per-question breakdown with the hardest questions first and a "Needs attention" flag.
* One-click **CSV export** (spreadsheet-safe).
* Built on LearnDash's own statistics, so enable "Statistics" on the quizzes you want to track.

= For learners =
* `[tkflld_my_quiz_results limit="10" show_pass="yes"]` shortcode, **My Quiz Results** Gutenberg block (with colour, spacing and font-size controls) and **Elementor widget** show the logged-in learner their recent attempts, with pass / fail.
* Encouraging results messages by score range, fully editable.
* Accessibility: screen-reader question announcements, visible focus, larger touch targets and an optional high-contrast mode.

= For site builders =
* Export / import settings as JSON to copy a setup between sites.
* Assets load only on LearnDash pages (or pages using LearnDash shortcodes/blocks).
* Hooks: `tkflld_skins`, `tkflld_load_front_assets`, `tkflld_can_view_answers`, `tkflld_capability`.
* Translation ready.

= Toolkit Pro (optional add-on) =
Install the Pro package over the free plugin and its modules appear on the **Pro** tab with on/off switches. The first module is **Certificates** for LearnDash:
* Unique certificate ID for every course or quiz certificate, issued automatically on completion.
* Public verification page and `[tkflld_verify_certificate]` shortcode (name shown in full, as initials or hidden), lookups rate-limited.
* `[tkflld_my_certificates]` page for learners with download, verify and "Add to LinkedIn" links.
* Email on issue, expiry and renewal reminders, revoke / reinstate / reissue, issue to past completers, CSV export, https webhook.
* WordPress personal data export and erase support.
The free plugin contains no Pro code; it only shows what Pro adds.

= Privacy =
Toolkit stores only its settings. It does not collect, track or send personal data and makes no external requests.

= Requirements =
LearnDash LMS must be installed for the quiz features to work. Toolkit is an independent add-on and is not affiliated with LearnDash.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` or install it from the Plugins screen.
2. Activate it.
3. Go to **LearnDash LMS > Toolkit** (or **Settings > Toolkit** if LearnDash's menu is not present).
4. Choose a theme and switch on the options you want.

== Frequently Asked Questions ==

= Does it work without LearnDash? =
Settings can be saved, but all features apply to LearnDash quizzes, so LearnDash is required.

= Why is the Analytics tab empty? =
LearnDash records statistics only for quizzes with "Statistics" enabled, and only after learners finish them.

= How do I get the Pro features? =
Install the Pro package over the free plugin (it adds a `pro` folder). No other setup is needed: the Pro tab then lists the modules.

= Does Certificates replace LearnDash certificates? =
No. LearnDash still designs and generates the certificate PDF. Toolkit Pro adds the unique ID, verification, emails, expiry and reporting around it.

= Does the plugin still edit LearnDash files? =
No. Versions before 2.0 rewrote LearnDash source files to implement case sensitivity. Version 2.0 uses LearnDash's own filter instead. If you used the old version, LearnDash restores its original files the next time LearnDash is updated or re-installed.

= Are correct answers exposed in page source? =
Not any more. Before 2.0 they were printed into the page for every visitor. Now they are fetched only when a learner clicks View Questions. Use the `tkflld_can_view_answers` filter to restrict this further.

= How do I add my own theme? =
Add a CSS file at `skins/css/my-theme.css` and register it: `add_filter( 'tkflld_skins', function ( $s ) { $s['my-theme'] = array( 'label' => 'My theme', 'desc' => '', 'url' => plugins_url( 'my-theme.css', __FILE__ ) ); return $s; } );`

== Screenshots ==

1. Quick start: choose a preset, theme and brand colour.
2. General settings: hide elements and quiz behaviour.
3. Themes tab with the colour and type editor and live preview.
4. Analytics: attempts chart, quiz overview and question breakdown.
5. Modern theme on a LearnDash quiz.
6. My Quiz Results block and Elementor widget.

== Changelog ==

= 2.2.0 =
* New: Pro module system. Drop a module into `pro/modules/<name>/` and it appears on the Pro tab with an on/off switch.
* New (Pro): Certificates module with unique IDs, verification page, learner certificate list, emails, expiry reminders, revoke / reissue, bulk issue, LinkedIn link, CSV and webhook.
* New: Pro tab in the free plugin that shows what Pro adds.
* New: modules can add their own admin tabs.
* Fix: Pro modules now load on `init` so translations are available at the right time.

= 2.1.0 =
* New: Elementor "My Quiz Results" widget with typography and colour controls.
* New: Gutenberg block now supports colour, spacing, alignment and font size.
* New: Quick start screen with presets (Friendly practice, Strict exam, Clean and minimal).
* New: Editable encouraging messages on the results screen.
* New: Accessibility improvements: screen-reader announcements, 44px touch targets, high-contrast mode.
* New: Analytics date ranges, attempts-per-day chart and "Needs attention" flag for hard questions.
* New: Dashboard widget and Health tab.
* Improved: the results shortcode, block and widget load their own styles on any page, in any page builder.

= 2.0.0 =
* Security: correct answers are no longer printed into every page; they load over AJAX with a nonce when View Questions is clicked.
* Security: settings are saved through a nonce- and capability-protected form with a whitelist; debug output and the GET-based reset were removed.
* Removed: Toolkit no longer rewrites LearnDash core files, and no longer starts a PHP session on every request.
* New: Modern and Dark themes, colour and type editor with live preview, per-quiz theme override.
* New: Quiz analytics (overview, hardest questions) with CSV export.
* New: Progress bar and Enter-to-continue for fill-in-the-blank questions.
* New: `[tkflld_my_quiz_results]` shortcode and My Quiz Results block.
* New: Settings export / import, optional data cleanup on uninstall.
* Improved: assets load only where needed, no bundled Bootstrap or FontAwesome (about 4 MB smaller), prepared SQL queries, translation-ready strings, text domain now matches the plugin slug.
* Tested with WordPress 7.1 and PHP 8.3.

= 1.1.1 =
* Maintenance release.

= 1.0.9 =
* Updated for WordPress version. [27/05/2024]

= 1.0.7 =
* New: Multiple correct answers within the curly braces and square brackets. [Thanks to Stephen Kanfer]

= 1.0.3 =
* New: Maintain upper or lower case as entered in editor when a user clicks on View Questions Button. [Thanks to Stephen Kanfer]

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.2.0 =
New: Pro module system with a Certificates module (unique IDs, verification page, expiry reminders). The free plugin gains a Pro tab.

= 2.1.0 =
New: Elementor widget, Quick start wizard, results messages, accessibility options, analytics date ranges and a Health tab.

= 2.0.0 =
Major update: safer answer handling, no more LearnDash file edits, new themes, analytics and learner results block. Please review Toolkit settings after updating and test your quizzes on staging first.

== License ==
This plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or any later version. It is distributed WITHOUT ANY WARRANTY. See https://www.gnu.org/licenses/gpl-2.0.html.
