General plugins

Receiving completed course notification to every participants

 
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: -