Hi,
Anyone have an idea that how to prevent email notification to all course participants? Notification should receive a person who has completed their course.
Thanks,
Azmat
Below is the capability and code for sending notification to all course participants. (quiz/locallib.php)
Here getting all course participants
$userstonotify = get_users_by_capability($context, 'mod/quiz:emailnotifysubmission',
Sending notification to course participants
// Send notifications if required.
if (!empty($userstonotify)) {
foreach ($userstonotify as $recipient) {
$allok = $allok && quiz_send_notification($recipient, $submitter, $a);
}
}