Course completion not working in Moodle™: what to check, in order
A learner has done everything you asked and Moodle still does not mark the course complete. Work through the nine checks below in order. Each one says where to look and what Moodle's code actually does at that step.
In short: Moodle marks a course complete only when completion tracking is on for the site and the course, the course has completion conditions, the learner is tracked, each required activity's own conditions are met as Moodle reads them (grades come from the gradebook), nothing hides a required activity from the learner, and, for most conditions, the regular completion task has run. Changed conditions are not recalculated unless you unlock them, and unlocking deletes everyone's course completion before rebuilding it.
By Rohin Grover, 16 November 2026. Checked against the Moodle 5.3.1 source code, with the main points compared against 4.5.16. Where 4.5 behaves differently, the text says so.
This page is about course completion: the record that says a learner has finished the course. That is separate from activity completion, the ticks beside each activity. A learner can have every tick and still not be complete in the course, and the reverse can happen too. Each check below depends on the ones above it, so it pays to go in order:
- Completion tracking is on for the site
- Tracking is on for the course, and the course has conditions
- The learner is one Moodle tracks
- How the conditions combine
- Each activity's own conditions
- The grade traps
- Something hides a required activity
- The completion tasks and cron
- Conditions changed after learners started
1. Completion tracking is on for the site
Go to Site administration > Advanced features and check Enable completion tracking. A new site has it on. When it is off, the completion fields disappear from course and activity settings and both completion tasks stop doing anything, so nothing further down this list can work.
2. Tracking is on for the course, and the course has conditions
In the course settings, under Completion tracking, Enable completion tracking must be Yes. Then open the course completion page (More > Course completion, inside the course) and check that at least one condition is set.
The second check matters because activity completion settings never complete a course on their own. Moodle works out course completion only from the conditions on that page. A course with none set never marks anyone complete, however many activity ticks a learner collects.
Only activities with completion tracking switched on are offered as conditions. If an activity you expect is missing from the list, its own completion setting is off.
3. The learner is one Moodle tracks
The completion reports and the course progress percentage only cover tracked users: people with an active enrolment in the course and the capability Be shown on completion reports (moodle/course:isincompletionreports). In a standard install only the Student role has that capability. So check three things:
- the enrolment is active, not suspended, and its end date has not passed;
- the person has the Student role, or a custom role that has the capability above;
- you are not testing with a teacher or manager account, which is not tracked.
The daily completion task in step 8 also only creates course completion records for active enrolments whose role is listed under Graded roles in the site's grade settings.
4. How the conditions combine
The course completion page has one overall rule, Completion requirements, set to either "Course is complete when ALL conditions are met" or "Course is complete when ANY of the conditions are met". Three conditions also have a rule of their own, Condition requires: Activity completion, Completion of other courses, and Manual completion by others.
Moodle settles each of those three first, within itself. Each result then counts as one condition and is combined with everything else you set (date, enrolment duration, unenrolment, course grade, manual self completion) by the overall rule. A rule that was never saved counts as ALL.
What to look for:
- An overall ANY that you meant as ALL. Under ANY, one met condition completes the course. If a Date condition is also set, everyone with a role in the course meets it once that date passes.
- Activity completion set to ALL, including an activity the learner cannot finish, such as a hidden one (step 7) or a quiz they can no longer pass (step 5).
- Manual completion by others set to ALL with more than one role ticked. Someone in each of those roles then has to mark the learner complete, not just one person. Only roles with the capability
moodle/course:markcompleteappear in that list. - Manual self completion with no way to do it. Learners mark themselves complete through the Self completion block, so the course needs that block.
5. Each activity's own conditions
Open the Activity completion report in the course (Reports > Activity completion) and find the activity the learner is stuck on. Then open that activity's settings, under Completion conditions. Every requirement ticked there has to be met. Moodle checks the core requirements (view, receive a grade, passing grade) and the activity's own rules together, and the activity counts as done only when all of them are.
Some settings make an activity impossible to finish for a particular learner:
- A quiz that requires a passing grade, without the option "Passing grade or all available attempts completed". A learner who uses every attempt without passing can never complete it. Ticking that option lets running out of attempts count as done.
- A minimum number of quiz attempts. Only finished attempts count. An attempt left in progress does not.
- Manual completion. The learner has to press Mark as done. Viewing the activity or handing in work does not complete it.
- SCORM packages. The status and score conditions read what the package reports back to Moodle. If the package never reports a completed or passed status, or never sends a score, those conditions are never met.
6. The grade traps
Grade conditions read the gradebook, not the activity's own grading page. That gives four traps.
"Passing grade" is required, but no grade to pass is set
When an activity requires a passing grade and its grade item has no grade to pass, Moodle counts any grade as a pass. A learner who scores 2 out of 10 is marked complete.
The activity settings form refuses this combination when you save it, but it still happens in two ways. Bulk edit activity completion lets you require a passing grade without checking for a grade to pass. And the grade to pass can be cleared later in Gradebook setup, which does not look at completion settings at all. The fix is to set Grade to pass on the grade item.
A grade to pass is set, but completion only needs "Receive a grade"
Here a failing grade still completes the activity, and the activity then counts towards course completion. If a pass is what you meant, tick Passing grade in the activity's completion conditions.
There is no grade in the gradebook yet
- A quiz attempt with a question that needs manual marking, such as an essay, has no total until it is marked, so the gradebook has no grade.
- An assignment that uses marking workflow keeps the grade out of the gradebook until its workflow state is Released.
- An assignment with Anonymous submissions keeps grades out of the gradebook until identities are revealed, unless "Allow partial release of grades while marking anonymously" is on.
In each case the teacher can see a mark, or expects one, and the condition keeps waiting.
The grade to pass changed after learners were graded
Moodle re-checks a learner's grade condition when that learner's grade is saved. Changing the grade to pass does not re-check learners who already have a grade, so their stored completion stays as it was until their grade changes again or the activity's completion is recalculated (step 9).
7. Something hides a required activity
Course completion conditions do not care whether the learner can open an activity. If a required activity is hidden, sits in a hidden section, or is behind an access restriction the learner cannot meet (a group they are not in, a date that has passed, a profile field, another activity), they cannot complete it. Under ALL, they can then never complete the course.
Moodle 5.3 adds a second symptom. The course progress percentage that learners see in My courses counts only the activities the learner can see on the course page, so it can reach 100% while course completion still waits on an activity they cannot see. In 4.5 the percentage counts every activity with completion tracking, visible or not.
To check, use Log in as from the learner's profile and look at the course page, or open the activity's Restrict access settings and the visibility of its section.
8. The completion tasks and cron
Two scheduled tasks do most of the work. Check both in Site administration > Server > Tasks > Scheduled tasks: when each last ran, whether it is disabled, and whether it shows a fail delay.
| Task | Default schedule | What it does |
|---|---|---|
Calculate regular completion data\core\task\completion_regular_task | Every minute | Runs each condition type's own check (activities, course grade, date, enrolment duration, other courses), then works out course completion for every learner who is not yet complete and has a change waiting. |
Completion mark as started\core\task\completion_daily_task | Once a day, at a time picked at random for each site | Creates a course completion record, dated from the learner's enrolment, for learners who do not have one yet. |
Both depend on cron. If cron does not run, the only course completions that still happen are the instant ones described next.
Since Moodle 4.0 (MDL-32103), when a single learner's activity completion changes, for example they finish a quiz or a teacher grades their assignment, Moodle checks that learner's activity conditions straight away and can mark the course complete on the spot. That covers activity conditions only. Everything else waits for the regular task:
- date, enrolment duration, course grade, other courses, manual self completion and manual completion by others;
- grades a teacher types into the grader report or single view in the gradebook, which Moodle saves as a bulk update and so leaves out of the instant check.
MoodleDocs' course completion FAQ still says all course completion waits for cron. For activity conditions, that has not been true since 4.0.
To run the regular task now instead of waiting, use Run now on the Scheduled tasks page (unless it has been switched off in the site's security settings), or run it from the command line in the Moodle install root. In 5.1 and later that is the folder above public/.
sudo -u www-data php admin/cli/scheduled_task.php \
--execute='\core\task\completion_regular_task'
9. Conditions changed after learners started
Moodle does not quietly recalculate completion when you change the rules. What happens depends on where you change them.
Changing the course completion conditions
Once any learner has met any condition, the course completion page locks and shows Completion settings locked. The only way to change it is the button Unlock completion settings and delete user completion data. That button deletes every learner's course completion record for the course, including the ones already complete, and the record of which conditions each learner met. Activity completion is not touched.
After you save the new conditions, the regular task rebuilds what it can from data Moodle still has: activity completion, the course grade, dates, enrolment duration and other courses. This is the workaround MoodleDocs' FAQ gives for forcing a recalculation, unsetting the course completion requirements and setting them again. Two things do not come back the way they were:
- Manual self completion and manual completion by others. Moodle has no record to rebuild them from, so learners have to mark themselves complete again and teachers have to mark them again.
- The original completion event. Each learner the task marks complete triggers the course completed event again and is sent the course completed notification again, and anything on your site that reacts to that event runs again. The completion date is taken from the latest condition each learner met, so for activity conditions it usually matches when they finished.
MoodleDocs also says learners must tick manually completed activities again after this. In the 5.3 code that is not needed after a course-level unlock, because activity completion is left alone and manual ticks count like any other completed activity. It is needed after the activity-level change below.
Outside that unlock, a learner already marked complete is never re-evaluated. Moodle only works out completion for learners who are not complete yet, and it never changes a completion date once it is set.
Changing an activity's completion conditions
When learners already have completion data for an activity, its settings show Completion options locked, with an Unlock completion settings button. If you unlock, change and save, Moodle deletes that activity's completion for everyone and recalculates it. Moodle's own warning says that manual completion cannot be recalculated, so learners have to mark those activities as done again.
There is a side effect the warning does not mention. If that activity is one of the course completion conditions, Moodle also deletes the course completion record of every learner in the course. Learners who still meet every condition are marked complete again straight away, with the date of your edit as their completion date, and they are sent the course completed notification again. If completion dates matter to you, for certificates or compliance reports, download the Course completion report before you change a live course.
A report for one learner
I am building Completion Doctor, a free report plugin that runs most of these checks for one learner in one course and lists what still blocks completion. It only reads data and changes nothing. It is in development and not released yet.
Where this comes from
Everything above was read in the Moodle 5.3.1 code (Build: 20261112), and the main points were compared with 4.5.16. The files that matter most, relative to public/ in 5.1 and later:
lib/completionlib.php: activity states, grade states, and how course completion is added up;completion/classes/api.php: which activity states count towards course completion;completion/completion_completion.php: marking a course complete, and why a completion date never changes;lib/classes/task/completion_regular_task.phpandcompletion_daily_task.php, with their schedules inlib/db/tasks.php;course/completion.phpandcourse/modlib.php: what unlocking deletes.
Also MoodleDocs' Course completion FAQ (last edited 27 July 2023) and tracker issue MDL-32103, fixed in Moodle 4.0.
If you have worked through the list and a learner is still not complete, or you need to change the completion rules on a course that is already running, I take on that kind of work. The services page sets out what I do and how a job is scoped.
Common questions
- How long does Moodle take to mark a course complete?
- When a single learner's activity completion changes, for example they finish a quiz or a teacher grades their assignment, Moodle checks that learner's activity conditions at once and can mark the course complete on the spot. This has been the case since Moodle 4.0. Every other condition, and grades entered in the grader report, wait for the scheduled task Calculate regular completion data, which runs every minute by default. A delay of hours points to cron, or to that task being disabled, rescheduled or failing.
- How do I make Moodle recalculate course completion?
- To process changes that are waiting, run the scheduled task \core\task\completion_regular_task from the Scheduled tasks page or the command line. To apply changed course completion conditions, you have to use Unlock completion settings and delete user completion data, which deletes every learner's course completion for that course. The regular task then rebuilds it from activity completion, grades and dates. Manual self completion and manual completion by others are not rebuilt and have to be marked again.
- Why does My courses show 100% when the course is not complete?
- The percentage counts activities that have completion tracking, not course completion conditions. A course with no completion conditions set, a course whose conditions include a date, a course grade or manual completion, or, in Moodle 5.3, a course that requires an activity the learner cannot see, can show 100% while the course stays incomplete.
- Why is a learner with a failing grade marked complete?
- Either the activity requires a passing grade but its grade item has no grade to pass, in which case Moodle counts any grade as a pass, or the activity only requires Receive a grade, in which case a failing grade completes it. Set Grade to pass on the grade item and tick Passing grade in the activity's completion conditions.
Talk it through with Rohin
Bring the messy version of the problem. A free 30-minute session is usually enough to tell you whether it is a small fix or a real project, and what it would take either way.