From 5a128471cc1f59dea4a9ea52881a7f58d58cf13b Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 12 Dec 2007 17:47:35 +0000 Subject: [PATCH] Fix notice. --- mod/quiz/locallib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/quiz/locallib.php b/mod/quiz/locallib.php index 3ad67040f5..2561b5f659 100644 --- a/mod/quiz/locallib.php +++ b/mod/quiz/locallib.php @@ -852,9 +852,14 @@ function quiz_send_notification_emails($course, $quiz, $attempt, $context, $cm) // check for notifications required $notifyfields = 'u.id, u.username, u.firstname, u.lastname, u.email, u.emailstop, u.lang, u.timezone, u.mailformat, u.maildisplay'; + $groups = groups_get_all_groups($course->id, $USER->id); + if (is_array($groups) && count($groups) > 0) { + $groups = array_keys($groups); + } else { + $groups = ''; + } $userstonotify = get_users_by_capability($context, 'mod/quiz:emailnotifysubmission', - $notifyfields, '', '', '', array_keys(groups_get_all_groups($course->id, $USER->id)), - $notifyexcludeusers, false, false, true); + $notifyfields, '', '', '', $groups, $notifyexcludeusers, false, false, true); // if something to send, then build $a if (! empty($userstonotify) or $sendconfirm) { -- 2.39.5