We would like an option to send quiz notifications to teachers only when the student got a failing grade. (This is only relevant for quizzes where a passing grade is set.)
However, currently this is not an easy option to add, because in the quiz, the only control over notifications are the capabilities:
- mod/quiz:emailconfirmsubmission - you need to override the permissions and allow this permission for students, for students to get a confirmation message when they submit their attempt.
- mod/quiz:emailwarnoverdue - similar but a bit different.
- mod/quiz:emailnotifysubmission - users (teachers) with this capability get an email when a student (in their group) submits a quiz.
So, there are clear settings on the settings form to control whether this quiz send notifications. There is no longer a need for a 'student' capability, because the more fundamental capability mod/assign:submit covers it. To determint which 'teachers' should get an email notification, there is a capability mod/assign:receivegradernotifications.
For quiz, on the settings form, this could look like:
Send a confirmation message to students when they submit [ No / Yes ]
Notify students when an attempt becomes overdue with a grace period [ No / Yes ]
(This one is conditional on the 'When time expires' setting)
Notify teacher when a student submits an attempt [ No / All attempts / Attempts with a failing grade ]
(This one would need validation so you can only select the last option if a grade to pass is set.)
As part of this, we would get rid on the mod/quiz:emailconfirmsubmission and mod/quiz:emailwarnoverdue capabilties. This will require some clever upgrade code, to correctly set the new options based on the previous roles setup, to ensure that the behaviour of every quiz is preserved.
Similarly, mod/quiz:emailnotifysubmission capability would be given to teacher (and non-editing teacher?) by default, with the quiz settings changed to preserve existing behaviour for each quiz.