From e44f2f92b06f945447c5c09e4ecc9e65f80e7dc4 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Wed, 18 May 2005 23:53:36 +0000 Subject: [PATCH] Now length is correctly set and stored to DB (bug 3290) (http://moodle.org/bugs/bug.php?op=show&bugid=3290) plus some added bits to handle the hidden field properly --- mod/quiz/restorelibpre15.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/quiz/restorelibpre15.php b/mod/quiz/restorelibpre15.php index 50c092e1bfe..aaa79faa0fc 100644 --- a/mod/quiz/restorelibpre15.php +++ b/mod/quiz/restorelibpre15.php @@ -167,6 +167,7 @@ //Iterate over questions for($i = 0; $i < sizeof($questions); $i++) { + $question = new object; $que_info = $questions[$i]; //traverse_xmlize($que_info); //Debug //print_object ($GLOBALS['traverse_array']); //Debug @@ -194,7 +195,9 @@ if (isset($que_info['#']['VERSION']['0']['#'])) { //Only if it's set, to apply DB default else. $question->version = backup_todb($que_info['#']['VERSION']['0']['#']); } - $question->hidden = backup_todb($que_info['#']['HIDDEN']['0']['#']); + if (isset($que_info['#']['HIDDEN']['0']['#'])) { //Only if it's set, to apply DB default else. + $question->hidden = backup_todb($que_info['#']['HIDDEN']['0']['#']); + } //Although only a few backups can have questions with parent, we try to recode it //if it contains something