From: tjhunt Date: Mon, 11 Dec 2006 17:12:04 +0000 (+0000) Subject: Restore notices. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f4b7d5a3f9e60e10710e120a9a421d248345c8c7;p=moodle.git Restore notices. --- diff --git a/mod/quiz/restorelib.php b/mod/quiz/restorelib.php index e745d6ad64..e9e7de6857 100644 --- a/mod/quiz/restorelib.php +++ b/mod/quiz/restorelib.php @@ -332,7 +332,11 @@ $status = true; //Get the quiz_attempts array - $attempts = $info['MOD']['#']['ATTEMPTS']['0']['#']['ATTEMPT']; + if (array_key_exists('ATTEMPTS', $info['MOD']['#'])) { + $attempts = $info['MOD']['#']['ATTEMPTS']['0']['#']['ATTEMPT']; + } else { + $attempts = array(); + } //Iterate over attempts for($i = 0; $i < sizeof($attempts); $i++) { @@ -406,7 +410,11 @@ $status = true; //Get the quiz_grades array - $grades = $info['MOD']['#']['GRADES']['0']['#']['GRADE']; + if (array_key_exists('GRADES', $info['MOD']['#'])) { + $grades = $info['MOD']['#']['GRADES']['0']['#']['GRADE']; + } else { + $grades = array(); + } //Iterate over grades for($i = 0; $i < sizeof($grades); $i++) {