]> git.mjollnir.org Git - moodle.git/commitdiff
Restore notices.
authortjhunt <tjhunt>
Mon, 11 Dec 2006 17:12:04 +0000 (17:12 +0000)
committertjhunt <tjhunt>
Mon, 11 Dec 2006 17:12:04 +0000 (17:12 +0000)
mod/quiz/restorelib.php

index e745d6ad642001ebda70b364d4a8c124f2beec9c..e9e7de6857b74e476425cfaac26adcbe83f11283 100644 (file)
         $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++) {
         $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++) {