Configuring Moodle Activity Completion to Track Student Progress
Learn how to enable Moodle activity completion, set a grade‑based condition on a Quiz, verify the storage in mdl_course_completions, and avoid common pitfalls.
01 Aug 2025, 07:40 UTC

Enable activity completion site‑wide
Before teachers can set completion rules for individual activities, an administrator must turn on the feature for the whole Moodle installation. Log in as an admin, go to Site administration ► Advanced features, locate the checkbox Enable completion tracking and tick it. Save changes. This makes the Activity completion section appear in every activity’s settings page.
Worked example: require a passing grade on a Quiz
- As a teacher, open the course where you want to track progress and turn editing on.
- Add a Quiz activity (or edit an existing one) and save it to reach the settings page.
- Click the Activity completion heading.
- Choose Show activity as completed when conditions are met.
- Under Condition: require grade, set the minimum grade to
70(or 70 %). Leave other conditions unchecked unless you also want to require a view or manual marking. - Save and return to the course.
When a student attempts the quiz, Moodle records a row in the mdl_course_completions table only after the grade condition evaluates to true. Until then the activity’s completion checkbox remains empty.
How completion data is stored
Each time an activity’s completion criteria are satisfied, Moodle inserts a row into mdl_course_completions with the columns:
userid– the student’s IDcourse– the course IDcoursemodule– the ID of the specific activity instancetimecompleted– Unix timestamp of when the condition was metcompletionstate–1for completed,0for not completed (the latter appears when criteria are evaluated and fail)
The cron job (or the scheduled task \tool_task\schedule_task) periodically aggregates these rows to update the course completion block and any reports that depend on activity completion.
Verification steps for administrators
- Confirm the feature is on: Site administration ► Advanced features ► Enable completion tracking is checked.
- Create a test course, add a Quiz, set its completion to Show activity as completed when conditions are met with a grade ≥ 70 %.
- Log in as a student, attempt the quiz and score below 70 %. Observe that the quiz’s completion checkbox stays empty.
- Retake the quiz and achieve a score of 70 % or higher. The checkbox should tick automatically.
- Optionally, force the cron task via CLI (run on the server with appropriate permissions):
Then inspect the database:php admin/tool/task/cli/schedule_task.php --execute=\\tool_task\\schedule_taskSELECT userid, coursemodule, timecompleted FROM mdl_course_completions WHERE coursemodule = (SELECT id FROM mdl_course_modules WHERE instance = <quiz_id> AND course = <course_id>);You should see a row withcompletionstate = 1for the passing attempt.
Limits and common mistakes
- Plugin compatibility: Only activities that implement the completion API (most core modules do) will update
mdl_course_completions. Third‑party plugins may lack this support; test them in a sandbox before relying on completion data. - Manual completion risk: If you select Students can manually mark the activity as completed, learners can tick the box without meeting any objective condition. For high‑stakes tracking, combine manual marking with at least one objective condition (e.g., require view) or avoid the manual option entirely.
- Changing criteria after attempts: Altering the grade threshold or adding a new condition after some students have already earned completion can reset their status to incomplete, causing confusion. Review the impact using the Completion tracking report (Reports ► Completion tracking) before saving changes, or clone the activity for a fresh start.
- Cron dependency: Completion statuses are not reflected in reports until the cron job runs. If you need immediate feedback during testing, trigger the task manually as shown above.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.