mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-51402 quiz: notification emails should respect grouping
In the case where teachers do not have the accessallgroups capability, we only send "an attempt has been sumbitted "notification to teachers in the same group as the student who submitted. At the moment this considers all groups in the course. If this particular quiz has a grouping set, then the logic should only consider the groups in that grouping.
This commit is contained in:
parent
d230899db8
commit
efc76e9e90
@ -1550,7 +1550,7 @@ function quiz_send_notification_messages($course, $quiz, $attempt, $context, $cm
|
||||
// Check for notifications required.
|
||||
$notifyfields = 'u.id, u.username, u.idnumber, u.email, u.emailstop, u.lang, u.timezone, u.mailformat, u.maildisplay, ';
|
||||
$notifyfields .= get_all_user_name_fields(true, 'u');
|
||||
$groups = groups_get_all_groups($course->id, $submitter->id);
|
||||
$groups = groups_get_all_groups($course->id, $submitter->id, $cm->groupingid);
|
||||
if (is_array($groups) && count($groups) > 0) {
|
||||
$groups = array_keys($groups);
|
||||
} else if (groups_get_activity_groupmode($cm, $course) != NOGROUPS) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user