From f4b7d5a3f9e60e10710e120a9a421d248345c8c7 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Mon, 11 Dec 2006 17:12:04 +0000 Subject: [PATCH] Restore notices. --- mod/quiz/restorelib.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mod/quiz/restorelib.php b/mod/quiz/restorelib.php index e745d6ad642..e9e7de6857b 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++) {