From 255985f17b35dc59f80c98ac82bcff17d11e5afe Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 28 Feb 2008 22:44:12 +0000 Subject: [PATCH] MDL-12776 - Quiz email notification and separate groups mode - student not in group -> all teachers get email I have changed it so that if the quiz is set to groups mode, and if the student is not in a group, then only teachers with 'accessallgroups' get emailed. --- mod/quiz/locallib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index defe8ae8cd..04114281ba 100644 --- a/mod/quiz/locallib.php +++ b/mod/quiz/locallib.php @@ -859,6 +859,11 @@ function quiz_send_notification_emails($course, $quiz, $attempt, $context, $cm) $groups = groups_get_all_groups($course->id, $USER->id); if (is_array($groups) && count($groups) > 0) { $groups = array_keys($groups); + } else if (groups_get_activity_groupmode($cm, $course) != NOGROUPS) { + // If the user is not in a group, and the quiz is set to group mode, + // then set $gropus to a non-existant id so that only users with + // 'moodle/site:accessallgroups' get notified. + $groups = -1; } else { $groups = ''; } -- 2.39.5