Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.7.11, 2.8.9, 2.9.3, 3.0, 3.1, 3.2, 3.11.3
-
MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_311_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
-
MOODLE_400_STABLE
-
MDL-52456-master -
Description
There is no feature to send a notification to a student when the teacher graded an essay question in a quiz.
In quiz module are two permissions that send mails to teacher when a student submits an attempt and to student for confirmation that the attempt is finished.
Added later: here is how we plan to implement this:
So, revised implementation plan:
- Create a new capability mod/quiz:emailnotifyattemptgraded given to no archetypes by default.
- Create a new quiz message type for this message.
- Add a new mod_quiz admin setting "Delay to notifiy graded attempts" mod_quiz/notifyattemptgradeddelay. Default value 5 hours.
- Add a new column gradednotificationsenttime to the quiz_attempts table, to store the timestamp when the 'graded' notification was sent.
- Change the quiz process_finish method, so that if there are no manually graded questions, or if the student does not have the capability, then set gradednotificationsenttime to the submit time (because there are no notifications to send) otherwise set it to null.
- Create a new scheduled task which, finds quiz attempts with
- state = 'finished'
- AND gradednotificationsenttime IS NULL
- AND sumgrades IS NOT NULL
- AND timemodified < now - mod_quiz/notifyattemptgradeddelay
- ORDER BY timemodified DESC (so we process most recently modified attempts first)
- For each of those attempts
- Check $attemptobj->get_display_options(true)->manualcomment. If this is question_display_options::HIDDEN then don't send the message now (but we will keep trying, in case this changes in future.) Otherise:
- send the message
- and set gradednotificationsenttime to now.
- Log that the message was sent.
At least in this first implementation, we will only ever send one automatic email for each quiz attempt. (If, later, a grade is changed, and the teacher wants to notify the student, they will need to send the message manually. This will be rare, handling it automatically is out-of-scope of this initial development.)
Attachments
Issue Links
- is duplicated by
-
MDL-53127 Notification for student when Quiz is graded
-
- Closed
-