Proposal: Improve Core Quiz Notifications (mod_quiz)
Hi all,
We recently developed a local plugin to enhance the quiz open notifications sent to students, and I’d like to suggest improvements that could be implemented directly in Moodle core to make these notifications more accurate, configurable, and informative — without requiring a custom plugin.
Current Limitations in Moodle Core
Notifications go to all users with mod/quiz:attempt:
This includes teachers, managers, and other non-students — even if they are not the intended audience.
No role-based filtering:
Core has no built-in way to restrict notifications to only student roles (e.g., role ID 5).
Fixed 48-hour notification window:
Moodle currently hardcodes a 2-day window (DAYSECS * 2) before the quiz opens, with no way to configure it.
No admin UI for notification settings:
There is no place in Site Administration where you can configure quiz notification behavior, delay, or targeting.
No way to customize the email content:
Administrators or developers cannot add custom HTML or plain text (e.g., exam preparation instructions) to the outgoing notification.
Group restrictions may not always be respected:
While availability restrictions exist, it’s unclear whether notifications fully respect group-level access (e.g. "Must match group A").
Suggested Improvements for Moodle Core
Add role filtering for quiz reminders
Let administrators limit notifications to specific role IDs (e.g., students only), avoiding unnecessary messages to staff or lecturers.
Add a configurable "days before" setting
Replace or override the current hardcoded 48-hour window with an admin-configurable value (e.g., 3, 7, or 14 days before).
Respect group access restrictions in reminders
Ensure the quiz reminder system uses core_availability::filter_user_list() or equivalent to only notify students who truly have access based on group rules or availability conditions.
Support content injection into the message
Provide a way for site admins to append HTML or plain text content to reminder emails (such as setup instructions, policies, links).
Expose developer hooks or override points
Allow developers to modify or extend the quiz reminder behavior (timing, roles, content) without needing to override core classes like notification_helper.
Real-World Use Case
We had the following requirements in a real academic environment:
Notify only students (not teachers or staff)
Respect group restrictions (e.g., "Must match group A")
Send the reminder exactly 7 days before the quiz opens
Include custom HTML instructions in the email:
"Complete Exam Setup"
"Install Google Chrome"
"Room Scan required"
"Review the Examination Policy"
To achieve this cleanly, we developed a local plugin. But these improvements could greatly benefit all Moodle sites if supported directly in core.
Would love to hear if this is being considered for a future roadmap, or if there’s interest in extending the mod_quiz notification system to make it more robust and flexible.