Moodle Course Completion Tracking: Enable, Configure, and Avoid Pitfalls
Configure Moodle course completion correctly: enable global tracking, set activity conditions (require passing grade, submission), define course criteria (ALL activities), and understand cron-driven evaluation. Covers common mistakes, limits, and verification steps.
13 Mar 2026, 11:37 UTC

The Problem: Learners Finish Activities But Courses Never Mark Complete
You've built a compliance course with a quiz and an assignment. Learners pass the quiz and submit the assignment, yet the course completion report shows \\\"In progress\\\" for everyone. The usual culprit: completion tracking wasn't enabled globally, activity conditions don't match the course criteria, or the cron job hasn't run yet. This guide walks through a working configuration, explains the evaluation mechanism, and highlights the limits that catch teams off guard.
Enable Completion Tracking Globally First
Before any course or activity settings take effect, the site-wide feature must be on. As an administrator, go to Site administration > Advanced features and check Enable completion tracking. Save changes. Without this, every activity completion checkbox in every course is inert—Moodle simply ignores the data.
Worked Example: Compliance Course with Quiz and Assignment
We'll configure a course that requires learners to pass a quiz (≥ 80%) and submit an assignment. Both activities must be complete before the course marks complete.
Step 1: Quiz Activity Completion
- Edit the quiz. Expand Activity completion.
- Set Completion tracking to Show activity as complete when conditions are met.
- Check Require passing grade.
- In the quiz's Grade section, set Grade to pass to
80(or 80% of the quiz maximum). This value is what the completion engine compares against. - Save.
Step 2: Assignment Activity Completion
- Edit the assignment. Expand Activity completion.
- Set Completion tracking to Show activity as complete when conditions are met.
- Check Require submission (and optionally Require grade if you want a graded submission).
- Save.
Step 3: Course Completion Conditions
- In the course, open Course administration > Course completion.
- Under General, leave Course completion status as default.
- Under Condition: Activity completion, choose Condition requires ALL selected activities.
- Select the quiz and assignment you just configured.
- Save changes.
How Evaluation Actually Works
Moodle does not evaluate completion the moment a learner clicks \\\"Submit\\\". The \\\\core_completion\\\\task\\\\cron_task runs on the site cron schedule (default every minute). When it runs, it:
- Loads each course's completion criteria.
- For each enrolled user, checks the
mdl_course_completion_crit_compltable for each criterion. - If all required criteria are met, inserts or updates a row in
mdl_course_completionswithtimecompletedset to the current timestamp. - Fires the
\\\\core\\\\event\\\\course_completedevent, which plugins (certificates, analytics, HR sync) can observe.
Because of the cron dependency, a learner who passes the quiz at 10:00:03 may not see \\\"Complete\\\" until the next cron tick at 10:01:00. On large sites, the cron interval may be longer or the task may be offloaded to an ad-hoc task queue.
Consuming Completion Data Programmatically
External systems (dashboards, HRIS, custom reports) can call the built-in web service:
POST /webservice/rest/server.php
wstoken=YOUR_TOKEN
wsfunction=core_completion_get_course_completion_status
moodlewsrestformat=json
courseid=42
userid=101
The response includes status (\\\"complete\\\" or \\\"incomplete\\\"), timecompleted, and per-criterion details. Enable the web service in Site administration > Plugins > Web services > Manage protocols and create a service with the core_completion_get_course_completion_status function.
Limits You'll Hit in Production
- No retroactive evaluation: Adding a new completion criterion after learners are enrolled does not re-evaluate existing users. You must click Re-evaluate course completion in Course administration > Reports > Course completion (or run the CLI task
php admin/cli/cron.phpafter enabling therecalculateflag in a local plugin). - Custom criteria require code: If you need \\\"complete when user posts in two different forums\\\" or \\\"complete after 30 days enrolment\\\", you must write a local plugin implementing
\\\\core_completion\\\\custom_completion. Core only supports activity completion, manual self-completion, date, enrolment duration, grade, and course grade. - Database lock contention: On sites with >50,000 enrolments in a single course, the cron task can lock
mdl_course_completionsfor seconds. Mitigations: split criteria across multiple courses, schedule cron off-peak, or implement a custom ad-hoc task that processes users in batches. - Certificates are not in core: Moodle records completion; it does not generate PDFs. Install
mod_certificateor a third-party plugin and configure it to trigger on thecourse_completedevent.
Common Mistakes Checklist
| Mistake | Why It Fails | Fix |
|---|---|---|
| Global completion tracking off | All activity/course settings ignored | Enable in Advanced features before configuring courses |
| Activity set to \\\"Students can manually mark\\\" | Learners must click a checkbox; no auto-tracking | Use \\\"Show activity as complete when conditions are met\\\" |
| Quiz has \\\"Require passing grade\\\" but no \\\"Grade to pass\\\" set | Engine has no threshold to compare | Set Grade to pass in the quiz's Grade settings |
| Assuming instant course completion | Cron runs every minute (or longer) | Wait for cron or trigger manually via CLI for testing |
| Testing as teacher with \\\"Switch role to Student\\\" | Teacher preview ignores completion logic | Enrol a real test student account |
| Bulk enrolment via CSV/cohort without re-evaluation | New users not evaluated until cron + criteria match | Run \\\"Re-evaluate course completion\\\" after enrolment sync |
Verification Steps on a Test Site
- Enable completion tracking (Site administration > Advanced features).
- Create a course, add a quiz with Grade to pass = 80.
- Turn on quiz activity completion: Require passing grade.
- Set course completion: Condition requires ALL > select that quiz.
- Enrol a test student (not a teacher with switched role).
- As the student, attempt the quiz until score ≥ 80%.
- Run cron:
php admin/cli/cron.php(or wait one minute). - Check Course administration > Reports > Course completion — the student should show \\\"Complete\\\".
- Call the REST endpoint
core_completion_get_course_completion_statuswith the courseid and userid; confirmstatus: \\\"complete\\\".
Rollback Consideration
Changing completion criteria after learners have started creates inconsistent states (some users marked complete under old rules, others not). If you must change criteria, clone the course, apply new rules, and enrol new cohorts there. For existing learners, either leave the original course unchanged or manually adjust completion records in the database (last resort, requires SQL expertise and backup).
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.