Moodle Quiz Auto-Grading: How Immediate Feedback Works for Multiple-Choice Questions
Moodle's quiz module can automatically grade multiple-choice questions and provide immediate feedback to students. This works by comparing each student's selected answer against the correct answer stored in the question bank during attempt processing.
10 Jan 2026, 14:02 UTC

Quick Answer: Auto-Grading MCQ in Moodle Quizzes
Moodle's quiz module can automatically grade multiple-choice questions and provide immediate feedback to students without instructor intervention. This works by comparing each student's selected answer against the correct answer stored in the question bank during attempt processing.
Configuration Steps
Before auto-grading functions, ensure these settings are configured:
- Enable automatic grading: Site admin > Plugins > Quiz > Automatic grading must be enabled
- Set feedback mode: In quiz settings, select 'Immediate feedback' under Review options
- Configure question type: Use standard MCQ question types (not multiple-answer variants)
Code Mechanism: How Answers Are Graded
When a student submits a quiz attempt, Moodle processes responses through the grade_question() function. This function checks the submitted answer against the correct property in the mdl_question_answers table:
SELECT id, answer, correct FROM mdl_question_answers WHERE questionid = ?
For each question, the system compares the student's response to records where correct = 1. If they match, the question receives full marks; otherwise, it receives zero. This happens during attempt processing, typically when the student submits or reviews their attempt.
Practical Example: Setting Up an Auto-Graded Quiz
Here's a concrete workflow:
- Create a new quiz in your course
- Add a multiple-choice question with one correct answer and several distractors
- In the question editing form, mark only one answer as 'Correct'
- Enable 'Immediate feedback' in quiz settings
- Save and test by submitting a practice attempt
After submission, the grade should appear instantly in the gradebook, and feedback messages display showing whether each answer was correct.
Limitations and Common Mistakes
Question Type Restrictions
Auto-grading only works reliably with single-answer multiple-choice questions. Questions allowing multiple selections require manual grading or specialized plugins. If you need multiple-select functionality, consider using the Multiple response question type with manual grading enabled.
Performance Considerations
Large quizzes with many questions can cause delays during auto-grading, especially when multiple students submit simultaneously. Monitor server performance and consider breaking large assessments into smaller quiz activities.
Common Configuration Errors
- Missing correct answer: Forgetting to mark any answer as correct results in all responses being marked wrong
- Multiple correct answers: Accidentally marking multiple answers as correct causes unpredictable grading
- Feedback disabled: Not enabling 'Immediate feedback' prevents students from seeing results until manual review
Verification Checklist
To confirm auto-grading works correctly:
- Create a test quiz with a single MCQ question
- Mark one answer as correct in the question bank
- Submit an attempt and verify the grade matches expected score
- Check that
mdl_question_answerstable showscorrect=1for intended answer - Confirm gradebook reflects the automatic grade after submission
Important Notes
Upgrading Moodle may change question type behavior - always verify auto-grading functionality after version updates. Custom question types may not support automatic grading without additional code development. For complex assessment needs, test thoroughly in a development environment before deploying to production.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.