An assignment feedback plugin for Moodle that leverages AI/LLM systems to automatically generate constructive feedback on student submissions. The plugin integrates seamlessly into Moodle's assignment grading workflow, supporting both manual batch operations and automatic feedback generation on submission.
- AI-Powered Feedback Generation — Automatically generate detailed feedback using configurable AI backends (Moodle Core AI Subsystem or local_ai_manager).
- Rubric Integration — When rubric grading is configured, rubric criteria are automatically included in the AI prompt for context-aware feedback.
- Multiple Submission Types — Supports online text submissions, file submissions (with text extraction), and image analysis (PNG, JPEG, WebP, GIF).
- Auto-Generate on Submission — Optionally generate AI feedback automatically when a student submits their assignment (configurable per assignment).
- Batch Operations — Generate or delete AI feedback for multiple students at once from the grading table.
- Regenerate Button — Teachers can regenerate feedback for individual students directly from the grading form via AJAX.
- Configurable Prompt Template — Structured prompt template with placeholders for submission text, rubric criteria, teacher instructions, assignment name, and language.
- AI Disclaimer — Configurable disclaimer appended to every AI-generated feedback, with optional automatic translation to the student's language.
- Dual AI Backend Support — Choose between Moodle's built-in Core AI Subsystem (4.5+) or the local_ai_manager plugin for advanced features like usage quotas and role-based configuration.
- GDPR Compliant — Full Privacy API implementation for data export and deletion.
- Editable Feedback — Teachers can review and edit AI-generated feedback before releasing it to students.
- Moodle 4.5 or later (for Core AI Subsystem support)
- PHP 8.2 or later
- At least one AI provider configured:
- Core AI Subsystem: Configure an AI provider in Site Administration → AI → AI providers
- local_ai_manager (optional): Install and configure the local_ai_manager plugin
- For file submission analysis: A document converter plugin (e.g., Google Drive converter)
cd /path/to/moodle/mod/assign/feedback
git clone https://github.com/marcusgreen/moodle-assignfeedback_aif.git aif- Download the latest release from the Moodle Plugin Directory or GitHub Releases.
- Extract to
mod/assign/feedback/aif/. - Visit Site Administration → Notifications to complete the installation.
- Go to Site Administration → Plugins → Install plugins.
- Search for "AI Assisted Feedback".
- Click Install.
Navigate to Site Administration → Plugins → Activity modules → Assignment → Feedback plugins → AI Assisted Feedback.
| Setting | Description | Default |
|---|---|---|
| Enabled by default | Enable the plugin by default for new assignments | No |
| Prompt | Default prompt for new assignment instances | "Analyse the grammar in this text" |
| AI backend | Choose between Core AI Subsystem or local_ai_manager | Core AI Subsystem |
| AI purpose | Purpose identifier for local_ai_manager | feedback |
| Prompt template | Structured template with placeholders | (see Prompt Template System) |
| Disclaimer | Text appended to AI responses | "(This feedback was generated by an AI system...)" |
| Translate disclaimer | Auto-translate disclaimer to user's language | Yes |
When editing an assignment:
- Under Feedback types, enable AI Assisted Feedback.
- Enter a Prompt specific to this assignment (e.g., "Analyse grammar and content quality").
- Optionally enable Generate feedback automatically on submission.
- Enable "Generate feedback automatically on submission" in assignment settings.
- Students submit their assignments.
- An ad-hoc task is queued and processed by cron.
- AI feedback appears in the grading interface once the task completes.
- Navigate to the assignment's View all submissions page.
- Select one or more students using the checkboxes.
- From the "With selected..." dropdown, choose Generate AI feedback or Delete AI feedback.
- Confirm the action.
- Wait for cron to process the queued tasks.
On the single-student grading form, click the Regenerate AI feedback button to queue a new feedback generation for that student.
AI-generated feedback is displayed in an editor field. Teachers can freely edit the text before saving the grade.
The plugin supports two AI backends:
| Feature | Core AI Subsystem | local_ai_manager |
|---|---|---|
| Moodle Version | 4.5+ (built-in) | Any (separate plugin) |
| Setup | Configure provider in Site Admin | Install + configure plugin |
| Usage Quotas | No | Yes (per user/role) |
| Purpose-based Config | No | Yes |
| Role-based Access | No | Yes |
See AI Backends Documentation for detailed setup instructions.
vendor/bin/phpunit --filter assignfeedback_aifvendor/bin/behat --tags=@assignfeedback_aifSee Development Guide for detailed testing instructions.
Comprehensive documentation is available in the docs/ directory:
- Architecture Overview — Technical architecture, class structure, data flow
- Admin Configuration — Detailed admin settings guide
- Teacher Guide — How to use the plugin as a teacher
- Prompt Template System — Template customization, placeholders, examples
- AI Backends — Backend comparison and setup
- Task System — Background processing, scheduled and ad-hoc tasks
- API Reference — External API, events, caching, privacy
- Development Guide — Contributing, testing, coding standards
This plugin stores AI-generated feedback text per student submission. The plugin implements
Moodle's Privacy API (\core_privacy\local\metadata\provider) and supports:
- Data export: AI feedback is included in user data exports.
- Data deletion: AI feedback is deleted when user data is purged.
- Context deletion: All feedback is removed when an assignment is deleted.
No personal data is sent to the AI provider beyond the submission content and prompt.
- Original Author: Marcus Green
- Contributors: Sumaiya Javed (Catalyst), Thom Rawson (inspiration and support)
- License: GNU GPL v3 or later


