protected function notify_student_submission_receipt(stdClass $submission) {
        global $DB, $USER;

        $adminconfig = $this->get_admin_config();
        if (empty($adminconfig->submissionreceipts)) {
            // No need to do anything.
            return;
        }
        if ($submission->userid) {
            $user = $DB->get_record('user', array('id'=>$submission->userid), '*', MUST_EXIST);
        } else {
            $user = $USER;
        }
        if ($submission->userid == $USER->id) {
            $this->send_notification(core_user::get_noreply_user(),
                                     $user,
                                     'submissionreceipt',
                                     'assign_notification',
                                     $submission->timemodified);
        } else {
            $this->send_notification($USER,
                                     $user,
                                     'submissionreceiptother',
                                     'assign_notification',
                                     $submission->timemodified);
        }
    }
protected function notify_student_submission_receipt(stdClass $submission) {
        global $DB, $USER;

        $adminconfig = $this->get_admin_config();
        if (empty($adminconfig->submissionreceipts)) {
            // No need to do anything.
            return;
        }
        if ($submission->userid) {
            $user = $DB->get_record('user', array('id'=>$submission->userid), '*', MUST_EXIST);
        } else {
            $user = $USER;
        }
        if ($submission->userid == $USER->id) {
            $this->send_notification(core_user::get_noreply_user(),
                                     $user,
                                     'submissionreceipt',
                                     'assign_notification',
                                     $submission->timemodified);
        } else {
            $this->send_notification($USER,
                                     $user,
                                     'submissionreceiptother',
                                     'assign_notification',
                                     $submission->timemodified);
        }
    }
protected function notify_student_submission_receipt ( stdClass $ submission ) { global $ DB , $ USER ; $ adminconfig = $ this -> get_admin_config ( ) ; if ( empty ( $ adminconfig -> submissionreceipts ) ) { // No need to do anything. return ; } if ( $ submission -> userid ) { $ user = $ DB -> get_record ( 'user' , array ( 'id' => $ submission -> userid ) , '*' , MUST_EXIST ) ; } else { $ user = $ USER ; } if ( $ submission -> userid == $ USER -> id ) { $ this -> send_notification ( core_user :: get_noreply_user ( ) , $ user , 'submissionreceipt' , 'assign_notification' , $ submission -> timemodified ) ; } else { $ this -> send_notification ( $ USER , $ user , 'submissionreceiptother' , 'assign_notification' , $ submission -> timemodified ) ; } }
Notify student upon successful submission.

@param stdClass $submission
@return void
Notify student upon successful submission .