MDL-15542 - followup bug fixes thanks to sam.
authortjhunt <tjhunt>
Mon, 28 Jul 2008 14:41:15 +0000 (14:41 +0000)
committertjhunt <tjhunt>
Mon, 28 Jul 2008 14:41:15 +0000 (14:41 +0000)
mod/quiz/processattempt.php

index f82383a04d21273850c5afce496cc63df686d077..9f50adb08d91f0d67cc013ab3495550629dee7b8 100644 (file)
@@ -158,7 +158,7 @@ if (!$success) {
 if (!$finishattempt) {
     $attempt->timemodified = $timenow;
     if (!$DB->update_record('quiz_attempts', $attempt)) {
-        quiz_error($quiz, 'saveattemptfailed');
+        quiz_error($attemptobj->get_quiz(), 'saveattemptfailed');
     }
 
     redirect($nexturl);
@@ -200,12 +200,12 @@ add_to_log($attemptobj->get_courseid(), 'quiz', 'close attempt',
 $attempt->timemodified = $timenow;
 $attempt->timefinish = $timenow;
 if (!$DB->update_record('quiz_attempts', $attempt)) {
-    quiz_error($quiz, 'saveattemptfailed');
+    quiz_error($attemptobj->get_quiz(), 'saveattemptfailed');
 }
 
 if (!$attempt->preview) {
 /// Record this user's best grade (if this is not a preview).
-    quiz_save_best_grade($quiz);
+    quiz_save_best_grade($attemptobj->get_quiz());
 
 /// Send any notification emails (if this is not a preview).
     $attemptobj->quiz_send_notification_emails();