Automatically detects wrong quiz answers and generates AI-powered micro-remediation modules. Each Revision Module includes an explanation, optional voiceover audio, optional explanatory image, and a check question with per-option feedback. Completion tracking ensures students engage with the material. See the plugin archive for release-specific requirements and feature availability.
Automatically generates a remedial quiz when a learner fails
▸ Standard Moodle remediation requires a teacher to manually create a separate quiz for students who fail, then manually enrol only those students. AI Quiz Remedial detects a failed quiz attempt, generates a new quiz with different questions at equivalent difficulty, and makes it available to only that learner — automatically.
▸ The remedial questions test the same competency elements as the original but in different scenarios, so students cannot pass the remedial quiz by memorising the original answers.
▸ Tracks remedial attempts separately from original attempts in the gradebook, giving teachers a clear picture of which students needed additional support and whether the remediation was effective.
Instead of just showing "Incorrect", this plugin generates personalised micro-remediation for every wrong answer while the mistake is still fresh. Students get a clear explanation of the concept they missed, an optional voiceover for audio learners, an optional AI-generated image for visual learners, and a check question to confirm they now understand — all created automatically with no teacher effort.
Event observer catches every quiz submission and identifies wrong answers
Clear, student-friendly explanations tailored to the specific question and wrong answer
TTS audio for explanations and per-option feedback (toggle on/off)
AI-generated explanatory images to support visual learners (toggle on/off)
4-option MCQ with per-option feedback to confirm understanding
Module completes on correct answer or after 2 attempts — no dead ends
attempt_submitted event instantly. This is lightweight and does not delay the quiz submission.local_aiqr_job table with status pending.https://lms-labs.com/api/quiz-remediation/generate. It generates: an explanation text, a 4-option check question with correct index, and per-option feedback text./local/aiquizremedial/index.php. They read the explanation, listen to the audio, view the image, answer the check question, see per-option feedback, and the module is marked complete when they answer correctly or after 2 attempts.Credit cost per wrong question adjusts dynamically based on which features you enable in the plugin settings. Admins can also customise the individual cost for each feature.
| Configuration | What's Generated | Credits per Question |
|---|---|---|
| Text Only | Explanation + check question + per-option feedback | 2 credits (default) |
| Text + Voiceover | Above + TTS audio for explanation and each feedback option | 4 credits (2 + 2) |
| Text + Images | Above (text) + AI-generated explanatory image | 6 credits (2 + 4) |
| All Features | Explanation + audio + image + check question + per-option feedback with audio | 8 credits (2 + 2 + 4) |
Example: A student gets 5 questions wrong on a quiz with Text + Voiceover enabled. That's 5 x 4 = 20 credits consumed. Credits are charged upfront per question before generation begins. If credits run out mid-batch, remaining questions are marked as failed and can be retried once credits are topped up.
aiquizremedial folder sits at /local/aiquizremedial/Requirements
Students access their Revision Modules at /local/aiquizremedial/index.php (or filtered by course with ?courseid=X). Each module shows the quiz name, a preview of the explanation, the credit cost, and a status badge: Not Started, In Progress, or Complete.
When a student opens a Revision Module, they see:
No. The event observer only creates a lightweight database record (a pending job). All AI generation happens asynchronously via the scheduled task, so the student's quiz submission is instant.
The scheduled task runs every 2 minutes by default. After the task picks up the job, generation takes a few seconds per question (depending on whether voiceover/images are enabled). So typically within 2-5 minutes of submitting a quiz, the Revision Modules are ready.
Any question type that uses Moodle™'s standard question engine and reports a fraction (score). This includes multiple choice, true/false, matching, short answer, numerical, and more. Essay questions are supported only if they have been graded (manually or by another AI plugin) at the time the cron task runs.
Any question with a fraction less than 1.0 (i.e. not fully correct) triggers a Revision Module. This includes partially correct answers on multi-select or matching questions.
Credits are charged per question during the cron task. If credits run out, the remaining per-question jobs are marked as failed with an error message. Once credits are topped up, you can re-run the scheduled task manually (or wait for the next cron cycle) and the failed jobs will not auto-retry — a new quiz attempt submission would be needed. Check the local_aiqr_jobtable for any failed jobs.
Yes. Users with the local/aiquizremedial:viewall capability (teachers, editing teachers, and managers by default) can view any student's Revision Modules. Students can only view their own modules via the local/aiquizremedial:viewown capability.
Yes. If the Central Config plugin (local_aiconfig) is installed and has a Site ID and API Key configured, this plugin automatically uses those values. The local Site ID and API Key fields in the plugin settings act as fallback overrides only.
For each wrong question, the plugin sends to the LMS Labs AI service (credit-based): the question text (HTML), the student's response data, the correct answer, the question type, and the quiz/course context. When voiceover or images are enabled, the explanation/feedback text is additionally sent to /api/tts/generate and/api/image/generate at lms-labs.com to produce audio and image inputs. Requests are posted tohttps://lms-labs.com/api/quiz-remediation/generate and related endpoints. Personal identifiers such as the Moodle™ user ID and course ID accompany requests for credit tracking.
Follow these test cases in order after installation. Complete all Admin Setup steps before running any test cases. You will need a test student account, a quiz with multiple choice questions, and a sufficient AI credits balance (minimum 20 credits recommended for a full run).
Cron required: Revision Modules are generated by the scheduled task, not at submission time. You must be able to trigger cron manually (Site Administration → Server → Scheduled tasks) or wait up to 2 minutes per test cycle.
pending appears in the local_aiqr_job database tablepending to completecompletelocal_aiqr_module table — one per wrong question/local/aiquizremedial/index.phplocal/aiquizremedial:viewall capability/local/aiquizremedial/index.php?userid=X with the test student's Moodle™ user IDCredit cost per wrong question depends on which features are active:
| Configuration | Cost per wrong question |
|---|---|
| Text only (all optional features off) | 2 credits |
| Text + voiceover | 4 credits |
| Text + images | 6 credits |
| Text + voiceover + images (this test) | 8 credits |
Historical release notes are retained below; consult the plugin archive for the applicable package.
When a teacher clicked Review Module on a student's Revision Module, the check question section displayed a blank interactive form as if the teacher were taking the module themselves. The student's actual answer and completion status were not shown.
view.php loaded the completion record for $USER->id (the teacher) rather than the student's user ID. Since the teacher had no completion record, the module appeared not started and the interactive form was shown. The teacher was also inadvertently creating a completion DB record for themselves on first visit.
A $teacherview flag is set when ?userid=X is in the URL and the viewer holds the viewall capability. $subjectuserid drives the completion lookup. In teacher-review mode no new completion record is ever created; the check question section renders read-only with options listed, the correct answer highlighted, and the student's completion status (Not Started / In Progress / Complete with attempt count) shown below.
After submitting a quiz with 2 wrong answers (out of 3 total questions), the quiz review page banner displayed: “Revision Modules Available — You have 1 question(s) to revisit” instead of the expected 2.
The banner's $pendingcount query counted only modules from child jobs with status='ready'. When a child job's AI generation failed (the inner try/catch in the cron task catches the error, marks the job status='failed', and creates no module), that wrong question had no module and was silently excluded from the count. The umbrella job was still marked ready (the outer loop continues after individual failures), so the banner was shown — but with a count of 1 instead of 2.
A new $wrongcount query counts all child jobs with questionid IS NOT NULL for the current attempt, regardless of status. The displayed count uses$displaycount = $wrongcount − $completedcount, where $completedcount = $modulecount − $pendingcount. The module-based $pendingcount is still used to toggle between the pending and all-complete banner states.