Completion Doctor documentation

Completion Doctor is a free report plugin for Moodle that answers one question: why is this learner not marked complete in this course? This page covers what it checks, how to install it, where to find it in Moodle, and how to report a problem.

In short: Completion Doctor (report_completiondoctor) is a read-only report. Pick a course and a learner and it checks the completion settings, the course completion criteria, each tracked activity, hidden and restricted activities and the completion tasks, then names what still blocks the learner, the most fundamental first. It supports Moodle 4.5 to 5.3 and is tested on each of those versions, stores no personal data, and is licensed under the GNU GPL v3 or later.

For version 0.4.2 (beta). Last updated 21 November 2026. Completion Doctor is free software under the GNU GPL v3 or later, written and maintained by Rohin Grover. The code and the issue tracker are on GitHub.

  1. What it answers
  2. The five checks
  3. Requirements and tested versions
  4. Installing
  5. Opening the report
  6. Who can use it, and on whom
  7. Privacy
  8. What it does not do
  9. Reporting a bug
  10. Changes
  11. Further reading

What it answers

Completion Doctor answers one question: why is this learner not marked complete in this course? You pick a course and a learner, the report runs five checks, and a verdict at the top lists what still blocks the learner. It is a report plugin, component report_completiondoctor. It only reads data: running it changes nothing on the site.

Completion Doctor in the course Workplace Safety Induction, with the learner Priya Sharma chosen. The verdict says she has not completed the course and names three things that block it, each with a link: her grade in Risk assessment is 55 out of 100, below the passing grade of 70, and that activity also keeps Induction feedback locked; Site walk-round checklist is not complete and still needs a submission; and Induction feedback waits for Risk assessment. Below it: 5 other learners in this course have not completed it, with a link to the course completion report. The completion tracking chain shows site tracking, course tracking and course completion criteria all enabled.
The report for one learner. The verdict names three causes, each once, the most fundamental first: a failing grade, a submission still to do, and an activity that waits for the one with the failing grade. The learners and the site in every screenshot are invented.

The verdict takes one of five forms:

  • This learner has completed the course.
  • This learner has not completed the course, followed by a numbered list of what is blocking it. Each activity or setting is named once, with its cause.
  • The requirements are met, but the course is not marked complete yet. Nothing blocks the learner and the completion tasks are on schedule. The next run of the regular completion task should mark the course complete.
  • The requirements look met, but the course is not marked complete, because the background completion tasks are not running on schedule, followed by the tasks that are late.
  • The requirements are met, but the course is not marked complete, and Moodle will not check this learner again on its own. Moodle checks a learner again only when one of their completion conditions is recorded, so waiting for the task will not help. This usually follows a change to the completion conditions after the learner had met them.

The list of what is blocking the learner starts with the most fundamental cause:

  1. completion switched off for the site or the course, or no course completion criteria;
  2. something no learner can complete as things stand: a required activity that is hidden, in a hidden section or subsection, without completion tracking, being deleted, closed by a permission or waiting for an activity learners cannot open, or self completion without a Self completion block to do it with;
  3. a grade below the passing grade;
  4. an access restriction the learner does not meet yet;
  5. what is simply not done yet;
  6. activities that wait for other activities the learner can still do.

An activity that is not done yet says what is still to do, in Moodle's own words ("Still to do: Make a submission"), or that the learner has not marked it as done. A grade below the passing grade also names any other rule of that activity still to do. An activity that waits for others is listed after them, and, unless any one of them is enough, each of those activities says that it keeps the waiting activity locked. Criteria such as a date, an enrolment duration, a course grade, unenrolment or another course say how they are met. Where any one of several criteria is enough, the options that no learner can complete as things stand are named with their cause.

Items link to the page where they are fixed: Advanced features or Manage blocks in Site administration, the course completion conditions, the course page, the course, section or activity settings, the activity permissions, the course completion report for an approval you can mark there, or the task pages. These links appear only for viewers who may change the setting there; other viewers are told whom to ask. Links that open an activity appear for every viewer: an activity the learner still has to do or pass links to itself, and an activity that waits for others links to each activity it waits for.

Completion tasks that are late do not fill the list while something else blocks the learner. They are a short note under the verdict, and only administrators are told where to look in Site administration. When everything else is done, the late tasks are the answer, unless Moodle will not check the learner again on its own; then that is the verdict.

Under the verdict, the report says how many other learners in the course have not completed it, with a link to the course completion report when there is at least one, you may view that report and the course has completion criteria. That count covers the learners you may diagnose (see who can use it), says "in your groups" when that is all it covers, and takes one database query.

The five checks

The report shows the checks in this order, each as its own section.

The full diagnosis for Priya Sharma. The verdict names three causes, each with a link, and 5 other learners have not completed the course. Completion tracking chain: three green ticks. Course completion criteria, each named in the first column, all required: Safety handbook and Hazard spotting video completed on 14 November 2026; Risk assessment, Site walk-round checklist and Induction feedback not complete; course completion status Incomplete. Activity breakdown: a table of seven activities with the columns Activity, Tracking, Requirements, State and Details; each activity has a status icon, and five are marked as course completion conditions. Risk assessment shows Done: Receive a grade and Failed: Receive a passing grade, the state Failed: below the passing grade, a grade of 55 against a pass of 70, and a note that it keeps Induction feedback locked. Practice task shows Complete, with a failing grade, and a warning that a passing grade is set in the gradebook but completion only needs a grade. Site walk-round checklist shows To do: Make a submission and the submission status No submission. Induction feedback shows To do: Submit feedback. Hidden from this learner or restricted: Induction feedback is not available to this learner yet, because it opens only when Risk assessment is marked complete. Background task health: the regular and daily completion tasks with green ticks, each with its last and next run.
The whole diagnosis, top to bottom: the verdict, the settings chain, the course completion criteria, the activity breakdown, hidden and restricted activities, and the completion tasks.

1. The settings chain

Three settings have to be on before Moodle can mark anyone complete: completion tracking for the site (Site administration > Advanced features), completion tracking in the course settings, and at least one course completion criterion on the course's Course completion page. The report shows each one. The first one that is off is the first item in the verdict, with a link to the page where it is switched on for viewers who may change it there, because nothing further down can complete the learner until it is. While completion tracking is off, the criteria row says it was not checked, and the activity table says that no activity tracks completion.

2. Course completion criteria

Each criterion on the Course completion page, named in the first column, with its type and, once this learner has met it, the date. An activity the learner has completed that Moodle has not recorded for the course yet is marked as waiting for the next run of the regular completion task, and counts as met. The report combines the criteria the way Moodle does. Activity, prerequisite course and role criteria are first combined within their own type, by that type's "all" or "any" rule. Each result then counts as one criterion and is combined with the others (date, enrolment duration, unenrolment, course grade, self completion) by the overall rule. So when a course needs any one of three activities, the two the learner skipped are not listed as blockers. The last row shows whether Moodle has marked the course complete for this learner.

3. Activities

Every activity with completion tracking, in course order. Each row starts with a status icon: a tick when the activity is complete, a cross when it is incomplete and holds up course completion, and an information icon when it is incomplete but does not affect course completion. An activity that is a course completion condition says so under its name. The columns are:

  • tracking: automatic, or manual (the learner marks it done);
  • requirements: each completion rule in Moodle's own words with the learner's status, as the course page shows them, for example "Done: View", "To do: Make a submission" or "Failed: Receive a passing grade";
  • state: Complete, Complete (passed), Incomplete, "Failed: below the passing grade" where completion needs the pass, or "Complete, with a failing grade" where completion only needs a grade, because Moodle counts that grade;
  • details: the learner's grade against the maximum and the pass grade, the number of finished quiz attempts, the assignment submission status as the assignment shows it (for example "No submission"), and any course completion condition the activity keeps locked.

Two grade traps are flagged on the activity:

  • A pass grade is set in the gradebook, but completion only needs "receive a grade". The learner can then complete the activity with a failing grade.
  • Completion asks for a passing grade, but the gradebook has no pass grade. Moodle then counts any grade, even a failing one, as complete. This is a warning, not a blocker, because the learner is not held back by it.

A grade below the pass grade, where completion needs a pass, is a blocker when the activity is a course completion condition. If that grade item is hidden in the gradebook, the report adds that the learner cannot see the failing grade that keeps the activity incomplete, and it names any other rule of the activity that is still to do.

4. Hidden and restricted activities

Activities with completion tracking, and sections, that this learner cannot open, with the reason: hidden by a teacher, in a hidden section or subsection, behind an access restriction such as a date, a group, a grade, a profile field or another activity (on the activity, its section or the subsection it sits in), or closed by a permission although its restrictions are met. A restriction with several conditions keeps them apart, and a nested set of conditions is shown in brackets. Each row says whether it keeps the learner from completing the course, which it does only when it holds back a course completion condition the learner has not met yet.

When a required activity waits only for other activities the learner can still do, the verdict lists it after them, as waiting for them (or for one of them, when any one is enough), with links to them. A chain of activities that unlock one after another is followed to its end. If an activity it waits for is not a completion condition and is closed itself, the entry also says what keeps it closed, such as a date or a group. Activities that wait for each other, for an activity no learner can open, or for something the other activity can never reach, such as a pass where no passing grade is set, are named as never opening, with the reason.

5. Background tasks

Moodle keeps course completion up to date with two scheduled tasks: Calculate regular completion data (\core\task\completion_regular_task) and Completion mark as started (\core\task\completion_daily_task). The report calls them the regular and the daily completion task. For each, it shows the last run and, while the task is on schedule, the next run. It reports a problem when:

  • the task is disabled, so it never runs;
  • its last run failed, and Moodle is waiting before it tries again;
  • its scheduled run is more than an hour in the past, which usually means cron is not running.

Each task is judged against its own schedule. The daily task runs once a day, so a last run several hours ago is normal and is not reported. The report also says when cron is switched off for the whole site, in Site administration > Server > Tasks > Task processing. Only administrators are told where to look in Site administration, with a link to the page; the verdict asks other viewers to have their site administrator check the tasks. While something else still blocks the learner, late tasks are a short note under the verdict, not items in it.

Requirements and tested versions

Moodle4.5 to 5.3
Tested onMoodle 4.5, 5.0, 5.1, 5.2 and 5.3
Databases testedPostgreSQL, MariaDB and MySQL
Themes checkedBoost on Moodle 4.5 and 5.3; Academi, Boost Magnific, Boost Union, Moove and Trema on 5.3 (November 2026, versions and notes)
Plugin typeReport, component report_completiondoctor
Version0.4.2, maturity beta
LicenceGNU GPL v3 or later
Stores dataNone (see privacy)

The tests are PHPUnit tests, Behat scenarios and Moodle's code checks (code style, PHPDoc, templates and the built JavaScript). They run in GitHub Actions on Moodle 4.5 with PostgreSQL and MariaDB, on 5.0 with MariaDB, on 5.1 and 5.2 with PostgreSQL, and on 5.3 with MariaDB, MySQL and PostgreSQL, using PHP 8.1 to 8.4. The built JavaScript is checked once, on 5.3 with MariaDB, because it differs between Moodle versions. The full list is the test matrix in the repository's workflow file.

The plugin declares support for Moodle 4.5 to 5.3, and every version in that range is in the test matrix.

Installing

The plugin is one folder, completiondoctor, which goes in Moodle's report folder. Where that is depends on the Moodle version:

Moodle versionPlugin folder
4.5 and 5.0report/completiondoctor
5.1 and laterpublic/report/completiondoctor

Both paths are relative to the folder that holds config.php. Moodle 5.1 moved the code that the web server serves into public/, and config.php stayed in the folder above it.

As a ZIP

  1. Download report_completiondoctor-0.4.2.zip from the 0.4.2 release on GitHub, where SHA256SUMS beside it lets you check the download.
  2. In Moodle, go to Site administration > Plugins > Install plugins, choose the ZIP under Install plugin from ZIP file, and install it. The installer reads the plugin type and folder from the ZIP.
  3. Follow the upgrade screens to the end.

The installer needs the web server to be able to write to the report folder. Sites that set $CFG->disableupdateautodeploy in config.php do not have the Install plugins page at all. In either case, install with git or by hand instead.

With git

From the folder that holds config.php:

# Moodle 5.1 and later
git clone https://github.com/hooknotdigital/moodle-report_completiondoctor.git \
    public/report/completiondoctor

# Moodle 4.5 and 5.0
git clone https://github.com/hooknotdigital/moodle-report_completiondoctor.git \
    report/completiondoctor

To update later, run git pull in the plugin folder, then finish the upgrade as below.

By hand

Unzip the ZIP, copy the completiondoctor folder into the plugin folder path in the table above, and make sure the web server user can read it.

Finishing the install

After a git or manual install, visit Site administration > Notifications and follow the upgrade screens, or run the upgrade from the command line in the folder that holds config.php:

sudo -u www-data php admin/cli/upgrade.php

Use your web server's user in place of www-data. The plugin adds no settings page. It adds one capability and one web service function, both described below.

Opening the report

There are three ways in, all to the same report:

  • In a course: open Reports in the course navigation (it is under More when the menu does not fit), then Completion Doctor. The course is fixed, and you pick the learner.
  • From a learner's course profile: open the learner from Participants, then Completion Doctor under Reports. The report opens already filled in for that learner.
  • From Site administration: Site administration > Reports > Completion Doctor. Pick the course, press Continue, then pick the learner.

After Run diagnosis, the page moves down to the report. Its address then names only the course and the learner, the same address the course profile link opens.

Priya Sharma's course profile in Workplace Safety Induction. The Reports box lists Completion Doctor first, above Today's logs, All logs, Outline report, Complete report, Grades overview and Grades.
The Completion Doctor link in the Reports section of a learner's course profile. It appears only for viewers who may diagnose that learner.

Finding a learner

Type at least two characters of the learner's name, email address or another identity field the site shows you, then pick the learner. The search runs in the database and shows at most 20 matches. When more match, a line above the box says so, and typing more narrows the list. Each match shows the name and the identity fields you may see, as set in Site administration > Users > Permissions > User policies > Show user identity.

The Learner field with ma typed in it. Three matches are listed with their email addresses: Fatima Haddad, Amara Nwosu and Priya Sharma.
The Learner field after typing "ma". Only learners you may diagnose are found.

Identity fields you may not see are never searched or shown. An email address that is not one of those identity fields only matches when the learner does not hide it, as in Moodle's own user search, and never when the site lists email under Hide user fields and you may not view hidden user fields in the course. The country field is not searched.

Finding a course

On the page opened from Site administration, the Course field is Moodle's own course search, limited to courses where you have the capability below. Courses with completion tracking switched off are listed too, because that is one of the things the report finds.

Completion Doctor opened from Site administration, Reports. The Course field has fo typed in it and lists two courses: Forklift refresher and Workplace Safety Induction.
The page opened from Site administration, with the Course field after typing "fo".

Neither field loads a full list into the page, so both work on sites with thousands of courses and learners.

Who can use it, and on whom

One capability controls the report: report/completiondoctor:view (View Completion Doctor diagnostics), in the course context. By default the Teacher, Non-editing teacher and Manager roles have it. It is marked as a personal data risk, because the report shows grades and enrolment details about a person. To narrow who can run it, change it in Site administration > Users > Permissions > Define roles, or override it in a category or course.

The page under Site administration checks the same capability at site level. In a standard install that means site administrators and users with the Manager role at site level.

The learners you may diagnose are the learners the course tracks for completion, as Moodle's own completion reports list them, except those whose site account is suspended:

  • an active enrolment in the course, and a site account that is not suspended;
  • the capability moodle/course:isincompletionreports (Be shown on completion reports), which in a standard install only the Student role has;
  • in a course with separate groups, only the learners in your own groups, unless you have moodle/site:accessallgroups.

The same rules decide who the Learner field finds, who is counted under the verdict, who gets the link on their course profile, and whom the report accepts when it is opened with a learner already chosen.

When the report is opened for someone you cannot diagnose, for example through a link made before the learner was suspended, the Learner field stays empty and the page says why instead of showing a diagnosis: not enrolled, enrolled with a role the course does not track, or, for a viewer limited to their own groups, not a learner in those groups. A suspended account, or an enrolment that is suspended, has ended or has not started, is named only to viewers who may review enrolments in the course; others are told that the user is not an active learner there. In a course with separate groups, a viewer without access to all groups who is in no group is told that there is no learner they can diagnose there.

Privacy

Completion Doctor stores no personal data. It has no database tables, no settings and no stored files, and it tells Moodle's privacy system so: Site administration > Users > Privacy and policies > Plugin privacy registry lists it as storing no personal data. It shows completion, grade, enrolment and identity data that Moodle already holds, only to people with the capability above, and only about learners they may diagnose. The one exception is the reason a user cannot be diagnosed, and that names a suspended account or enrolment only to viewers who may review enrolments in the course.

The Learner field searches through Moodle's AJAX web service, with the function report_completiondoctor_search_learners. It checks the capability in the course and returns only the learners and identity fields described above. The plugin sends nothing outside your Moodle site.

What it does not do

  • It does not fix anything. It does not recalculate completion, mark a learner complete, run a task or change a setting. The verdict links to the pages where its problems are fixed, when you may change them there.
  • It looks at one learner in one course at a time. The count of other learners who have not completed is its only figure for the whole course.
  • It reads completion as Moodle has stored it. It records nothing itself: an activity the learner has completed that Moodle has not yet recorded for the course is marked as waiting for the next run of the regular completion task, and the background task check tells you whether that task is running.

Reporting a bug

Report problems and ask for changes in the plugin's GitHub issues. A report is easiest to act on when it includes:

  • the Moodle version and build, shown at the foot of Site administration > Notifications, and the plugin version, shown in Site administration > Plugins > Plugins overview;
  • what the report said, and what you expected it to say;
  • the completion settings involved: the overall rule on the Course completion page, the criteria, and the completion conditions of the activity in question;
  • any error message, ideally with debugging switched on (Site administration > Development > Debugging).

Issues are public. Leave out learners' names, email addresses and grades: describe the case with made-up names, and crop or blur them out of screenshots.

Changes

The full list is in CHANGES.md.

  • 0.4.2, 21 November 2026. On a phone, the links after a verdict entry no longer end up on lines of their own with no space between them: each link is a little taller, with a small gap above and below. The README names the themes the report has been checked on, and three faults in those themes that are not the report's.
  • 0.4.1, 20 November 2026. The verdict names each thing that blocks the learner once, with its cause, the most fundamental first, and links to the page where it is fixed for viewers who may change it there; others are told whom to ask. The activity table describes each requirement in Moodle's own words with the learner's status, and every row has a status icon. Activities that wait for other activities are listed after them, and chains of waits are followed to the end. Late completion tasks are a note under the verdict. A user who cannot be diagnosed is told why. Fixed: a required activity that is hidden, in a hidden or restricted section, or closed by a permission is named with its cause; an activity done but not yet recorded is no longer listed as not complete; restrictions on activities that are not completion conditions are no longer listed as blockers; the session key no longer appears in the address after a diagnosis. Several fixes for keyboard and screen reader users.
  • 0.4.0, 16 November 2026. Maturity is beta. On a phone, the activity table scrolls inside its own box instead of making the whole page scroll sideways, and the box can be scrolled with the keyboard. The GPL licence text and the bug tracker address were added.
  • 0.3.0, 15 November 2026. The Learner field searches as you type instead of listing every learner, and the Course field on the Site administration page is Moodle's course search. A Completion Doctor link in the Reports section of a learner's course profile. The count of other learners who have not completed the course. Learners whose site account is suspended are no longer offered, counted or accepted.
  • 0.2.0, 15 November 2026. Two wrong diagnoses fixed: per-type "all" or "any" rules were ignored when combining criteria, and the daily completion task was reported as overdue two hours after it ran. A missing pass grade is a warning, not a blocker. Cron switched off is reported. Separate groups are respected. Status icons are Moodle icons with text alternatives. PHPUnit tests and Behat scenarios, run in GitHub Actions.
  • 0.1.0, 20 July 2026. First version.

Further reading

Course completion not working in Moodle: what to check, in order works through the same problem by hand, as nine checks, with what Moodle's code does at each step. It also covers ground the report leaves out: which learners Moodle tracks, what happens when completion rules change after learners have started, and how to run the regular completion task straight away.

Common questions

Does Completion Doctor change anything on the site?
No. Every check only reads. It does not recalculate completion, mark anyone complete, run a scheduled task or change a setting. When a setting needs changing, it links to the page where that is done if you may change it there, and otherwise tells you whom to ask.
Why can I not find a learner in the Learner field?
The field finds only learners you may diagnose: an active enrolment, an account that is not suspended, and the capability moodle/course:isincompletionreports, which in a standard install only the Student role has. In a course with separate groups you find only the learners in your own groups, unless you may access all groups; if you are in no group there, the page says that there is no learner you can diagnose. Type at least two characters; at most 20 matches are shown, so type more to narrow a long list.
What does "The requirements are met, but the course is not marked complete yet" mean?
The report found nothing that still blocks the learner, and the completion tasks are on schedule, but Moodle has not recorded the course completion yet. The scheduled task Calculate regular completion data records it, so the next run of that task should mark the learner complete. Two other verdicts cover the cases where waiting for that run is not enough: one says the requirements look met but the completion tasks are not running on schedule, and names the late tasks; the other says Moodle will not check this learner again on its own, which usually follows a change to the completion conditions after the learner had met them.
Why does the report say a completion task is overdue?
A task is reported when it is disabled, when its last run failed, or when its scheduled run is more than an hour in the past. The last case usually means cron is not running. On a test site without cron, the regular completion task, which is due every minute, shows as overdue about an hour after it last ran, and the daily task an hour after its next scheduled run, which is correct: completion is not being updated there. While something else still blocks the learner, late tasks are a short note under the verdict; they are the verdict itself only when everything else is done.
Which Moodle versions does it support?
Moodle 4.5 to 5.3. The automated tests run on every version in that range: Moodle 4.5, 5.0, 5.1, 5.2 and 5.3.
Rohin's Brain
Ask about Moodle, multi-tenancy with IOMAD, plugins, reports, support, or whether your project is a fit for Hooknot Digital.