From: moodler <moodler>
Date: Mon, 21 Oct 2002 12:39:46 +0000 (+0000)
Subject: Some error checking
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e909c8d0903cfcd0de735a73c164886af0360d03;p=moodle.git

Some error checking
---

diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php
index 879da90564..056167c579 100644
--- a/mod/quiz/lib.php
+++ b/mod/quiz/lib.php
@@ -754,6 +754,7 @@ function quiz_save_best_grade($quiz, $user) {
 /// and then saves that grade in the quiz_grades table.
 
     if (!$attempts = quiz_get_user_attempts($quiz->id, $user->id)) {
+        notify("Could not find any user attempts");
         return false;
     }
 
@@ -764,6 +765,7 @@ function quiz_save_best_grade($quiz, $user) {
         $grade->grade = $bestgrade;
         $grade->timemodified = time();
         if (!update_record("quiz_grades", $grade)) {
+            notify("Could not update best grade");
             return false;
         }
     } else {
@@ -772,6 +774,7 @@ function quiz_save_best_grade($quiz, $user) {
         $grade->grade = $bestgrade;
         $grade->timemodified = time();
         if (!insert_record("quiz_grades", $grade)) {
+            notify("Could not insert new best grade");
             return false;
         }
     }