Compatibility note: This version is compatible from Moodle 4.5 to Moodle 5.1.
Added
Authoritative rubric matching by Moodle IDs (strict mode).
The AI service now stamps each rubric criterion with its Moodle id (criterionid) and the chosen level with its id (levelid), and the plugin resolves the rubric filling exclusively through those ids. Mode is detected per stored record in feedback_applier::resolve_rubric_criteria(): if any criterion carries a numeric id the record is strict (id-only resolution, never falling back to name or points — including mixed records), otherwise it is legacy and keeps the previous name/points matching. This removes the dependency on criterion names, which the LLM can mangle in production (accents stripped, \r\n removed).
Typed failure reasons for unmatched criteria.
Each unresolved criterion reports a machine-readable reason (missing_criterion_id, unknown_criterion_id, missing_level_id, unknown_level_id in strict mode; name_not_found, points_not_found in legacy mode). The error_rubricmismatch exception message now includes the per-criterion detail (name, reason and mode), which is persisted into the pending record's errormessage and therefore visible in the AI history log.
Rubric match diagnostics in the history log (history.php?logid=).
The per-record log now shows the record's matching mode (strict/legacy), one line per AI criterion with its match outcome (matched by id, matched by name/points, or not matched with the failure reason) and the full rubric JSON returned by the AI, pretty-printed. The block appears both on screen and in the downloaded log, and is guarded so a diagnostics failure never breaks the log page. New language strings added to all nine language packs.
Teacher notification when AI grading fails permanently.
New gradingfailed message provider (db/messages.php): when an AI review fails and the automatic retries are exhausted (3), the configured grader receives a Moodle notification (popup + email) naming the assignment, student and last error, with a link to the AI history log.
Student "feedback available" notification on AI grade application.
After the AI grade is applied, the plugin queues the standard mod_assign feedback notification via notify_grade_modified(), honoring the assignment's "Notify students" setting.
Scale-grade support for AI numeric grading.
Assignments graded with a scale are now supported: the scale point count is sent to the AI as the maximum grade and the returned value is translated to a valid 1-based scale index (clamped to the scale range).
Feedback-comments plugin checks.
AI feedback text is only stored and rendered when the comments feedback plugin is enabled for the assignment and visible site-wide; otherwise the message is skipped and the "View details" button is hidden in the review table.
Assessment guide response in backup/restore.
The assessment_guide_response field is now included in plugin backup and restored (defaulting to null for older backups).
Changed
rubric_response now persists the criterion and level ids returned by the AI service. The response normalizer in assign_submission.php no longer strips them, and the duplicated normalization logic was extracted into a single helper. Records stored by older plugin/service versions (without ids) remain fully supported through legacy mode.
advanced_grading::build_rubric_response() includes the criterion and level ids when rebuilding the stored response after a teacher manually re-grades, keeping synced records in strict mode.
Grader form injection resolves by ids (amd/src/inject_ai/inject_rubric.js).
In strict mode the injector selects the exact level radio via `input[name$="[criteria][