/** * Triggers the sending of the notification emails at the end of this attempt. */ public function quiz_send_notification_emails() { quiz_send_notification_emails($this->course, $this->quiz, $this->attempt, $this->context, $this->cm); }
print_error('errorprocessingresponses', 'question', $CFG->wwwroot . '/mod/quiz/attempt.php?q=' . $quiz->id . $pagebit); } add_to_log($course->id, 'quiz', 'close attempt', 'review.php?attempt=' . $attempt->id, $quiz->id, $cm->id); } /// Update the quiz attempt and the overall grade for the quiz if ($responses || $finishattempt) { if (!update_record('quiz_attempts', $attempt)) { error('Failed to save the current quiz attempt!'); } if ($attempt->attempt > 1 || $attempt->timefinish > 0 and !$attempt->preview) { quiz_save_best_grade($quiz); } } /// Send emails to those who have the capability set if ($finishattempt && !$attempt->preview) { quiz_send_notification_emails($course, $quiz, $attempt, $context, $cm); } if ($finishattempt) { if (!empty($SESSION->passwordcheckedquizzes[$quiz->id])) { unset($SESSION->passwordcheckedquizzes[$quiz->id]); } redirect($CFG->wwwroot . '/mod/quiz/review.php?attempt=' . $attempt->id, 0); } // Now is the right time to check the open and close times. if (!$ispreviewing && ($timestamp < $quiz->timeopen || $quiz->timeclose && $timestamp > $quiz->timeclose)) { print_error('notavailable', 'quiz', "view.php?id={$cm->id}"); } /// Print the quiz page //////////////////////////////////////////////////////// // Print the page header require_js($CFG->wwwroot . '/mod/quiz/quiz.js'); $pagequestions = explode(',', $pagelist);
/** * Triggers the sending of the notification emails at the end of this attempt. */ public function quiz_send_notification_emails() { quiz_send_notification_emails($this->get_course(), $this->get_quiz(), $this->attempt, $this->quizobj->get_context(), $this->get_cm()); }