How to make Moodle course completions expire for annual training
Moodle has no setting for completions that expire. The options for yearly compliance training, why a simple completion reset undoes itself, and a free plugin that does it properly.
Short answer: Moodle can’t do it on its own. A course completion counts forever. If your staff must redo fire safety, safeguarding or data protection every year, you need a plugin, or someone resetting courses by hand.
This post covers the options, the trap that catches most home-made solutions, and the open source plugin we built for it.
Why doesn’t Moodle have this already?
Moodle records when a learner completes a course and stops there. The request to let a learner retake a course by clearing their activity data has been open on the Moodle tracker since 2012, with 36 votes.1 Schools, hospitals, care providers and companies with mandatory training all hit it.
What are the options?
| Option | What it does | Catch |
|---|---|---|
| Course reset (Moodle core) | Clears completions, grades and attempts in a course | For everyone at once. Fine for a new cohort, useless when each learner completed on a different day |
| Manual: export, chase, reset by hand | A spreadsheet of who expires when, and emails | Works for 20 people. Breaks at 200, and leaves no record |
| A paid plugin | Course recompletion is sold on the Moodle Marketplace at US$25 a year2 | A yearly fee, and it’s per site |
| A free, open source plugin | Recertification, which we built and publish under the GPL | Stable 1.0. As with any plugin that removes data, try it on a test site first |
Why does a simple completion reset undo itself?
This is the part most custom solutions get wrong, so it’s worth understanding even if you never use our plugin.
Moodle doesn’t store activity completion as a fact that stays put. It recalculates it from the activity’s own data whenever something triggers an update, and opening the activity is one of those triggers. For a quiz with “pass to complete”, that data is the grade and the attempts.
So if a script deletes a learner’s completion records but leaves the old quiz attempt and grade in place, this happens:
- The learner’s certification expires. The script clears their completion.
- The learner opens the quiz to retake it.
- Moodle checks the quiz, finds a passing grade, and marks it complete again.
- Cron runs, and the course is complete again. The learner is “certified” without retaking anything.
We wrote that exact sequence as an automated test before writing our reset, and watched a completion-only reset fail it. The fix is to remove the data completion is calculated from: quiz attempts, SCORM tracking, gradebook grades. Each goes through the module’s own API, so Moodle logs the deletions and the gradebook stays consistent. Archive all of it first, so nothing is lost.
How the Recertification plugin works
You switch it on per course and set how many days a completion stays valid (365 for a yearly refresher) and when to remind people (30 and 7 days before, by default). A daily task does the rest:
- Reminders. Each learner gets the nearest reminder once, even if cron missed a few days.
- Expiry. On the day it expires, the learner’s completion, grades, course total, quiz attempts and SCORM tracking are copied into a history table, then reset. The learner gets a message saying to complete the course again.
- Status page. Every learner shows as valid, expiring soon, expired or not completed, with dates. It works while recertification is off, and says how many learners would be reset in the next 7 days, so switching it on is never a surprise.
- Reports. Past certifications feed a report builder source, for compliance reports across the site.
What it doesn’t do yet: reset assignment submissions. If your course needs a fresh assignment each year, that’s on the list, or we can build it for you.
It supports Moodle 4.5 to 5.3 and is tested on each of them. The code and test reports are on GitHub.
When should you pay for custom work instead?
When your rules are more specific than “every N days”: a different period per role or department, certification dates fed from your HR system, certificates issued on renewal, or managers who need a dashboard of their team’s status. Those sit well on top of the plugin. See what custom plugins cost, or get a fixed quote for your rules.
Sources
Need a Moodle plugin built or rescued?
Tell the scoping assistant what you need. You get a fixed price and a timeline in a few minutes, and an engineer reviews it within one business day.
Get a fixed quote