-
Bug
-
Resolution: Fixed
-
Minor
-
3.6.6, 3.7.2
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MDL-66915-master -
If you have an assignment that uses the marking workflow, it might happen that the notifications get stuck in the cron and show up on every cron run. The foreach loop in the function assign::cron() skips every user who is not enrolled in the course or if the assignment is hidden. The cron function tries to send these notifications the next time again and again.
If marking workflow is disabled, the cron function tries to send the notifications only if the grade was updated in the past 24 hours. I think this should also be the behaviour if marking workflow is enabled.
Original testing instructions for posterity:
- Create a new course.
- As a teacher, add an assignment activity (enable "Use marking workflow").
- As a student, add a submission.
- As teacher, grade the submission and set the workflow state to released. Save changes (enable "Notify students").
- Unenrol the student from the course.
- Start the Moodle cron process. (e.g. execute "php admin/cli/cron.php" in the Moodle directory). This will run all cron jobs. You have to search the log output for the assign cron job. If you have pathtophp set in your Site administration you could also run the cron job 'mod_assign\task\cron_task' ("Background processing for assignment module") directly from the UI on admin/tool/task/schedule_task.php
- Without the patch, every time (once per minute) you run the assign cron you see the log output (Moodle never gives up):
Processing x assignment submissions ...
Processing assignment submission x ...
user x not an active participant in x
- With the patch, Moodle will only try to send the notification within 24 hours after the grade was updated (and give up afterwards).
- Without the patch, every time (once per minute) you run the assign cron you see the log output (Moodle never gives up):
- Try the cron job run 24 hours later and the message 'user x not an active participant in x' (BTW: that's not even a proper phrase) won't appear any more. To speed up this procedure, you could modify the assign_grades table and set back the timemodified value by 86400 of the row that corresponds with the grade from step 4.