General plugins

Receiving completed course notification to every participants

 
Azmatullah
Receiving completed course notification to every participants
 

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 

 
Average of ratings: -
Azmatullah
Re: Receiving completed course notification to every participants
 


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);

        }

    }

 
Average of ratings: -