Cap late work at the pass mark in Moodle
Many universities cap late coursework at the pass mark instead of taking a percentage off. Our free gradepenalty_cap applies that rule in Moodle 5.0 to 5.3.
Short answer: Moodle 5.0 added automatic late penalties, but the built-in one takes a percentage off per day. Many universities use a different rule: work up to five working days late is capped at the pass mark, and later work gets zero. UCL and Durham both use a version of it. Our free plugin, gradepenalty_cap, applies that rule in Moodle.
This is the twelfth plugin in our series: one plugin for each Moodle plugin type, each one teaching DevLMS Studio, our AI plugin builder, how that type works.
What it does
- Late work is capped at the assignment’s “Grade to pass”. If it has none, at a site percentage (40% by default).
- Work that is already below the pass mark keeps its mark. A late 30 stays 30; a late 80 becomes 40.
- The late window is 5 working days by default, Monday to Friday in the site time zone. You can count weekends instead.
- After the window, the work gets the minimum grade, or keeps the cap if your policy says so.
- Extensions and user overrides count: Moodle hands the plugin the student’s own due date.
Setting it up
- Site administration > Grades > Grade penalties > Manage penalty plugins: enable “Cap late work at the pass mark”. Use it instead of the built-in “Late submission penalties”, not alongside it, because the two add up.
- Manage supported activities: tick Assignment.
- Set the pass mark, the window and what happens after it on the plugin’s settings page.
- In each assignment, turn on “Grade penalties” under Grade.
It needs Moodle 5.0 or later, because grade penalty plugins did not exist before. The code is on GitHub.
How a grade penalty plugin works
From Moodle 5.3’s penalty code and its built-in late penalty:
- When a teacher grades late work, the activity hands Moodle the submission date and the student’s due date. Moodle then asks each enabled penalty plugin how many points to take off.
- A plugin answers in points, never in percent, and can never add points. The answers from all plugins are added together, which is why two penalty plugins on at once punish twice.
- A cap is still a deduction: the points between the current grade and the pass mark.
- Moodle never penalises a grade a teacher overrode or locked.
We tested it with PHPUnit through Moodle’s own penalty code (on time, an hour late, below the pass mark, the last working day, one hour past the window, weekends counted, “Grade to pass” set) and a browser test of the settings page.
Need a plugin like this for your own Moodle?
Describe it in DevLMS Studio and watch it built and tested in a real Moodle, or ask our team for a fixed price.
Open DevLMS Studio