MDL-15290 - Missing question types not handled properly on backup.

This commit is contained in:
tjhunt
2008-06-18 14:29:40 +00:00
parent 72c5387098
commit aa0716e1ea
+6
View File
@@ -176,6 +176,12 @@
$counter = 0;
//Iterate over each question
foreach ($questions as $question) {
// Deal with missing question types - they need to be included becuase
// user data or quizzes may refer to them.
if (!array_key_exists($question->qtype, $QTYPES)) {
$question->qtype = 'missingtype';
$question->questiontext = '<p>' . get_string('warningmissingtype', 'quiz') . '</p>' . $question->questiontext;
}
//Start question
$status = $status && fwrite ($bf,start_tag("QUESTION",$level + 1,true));
//Print question contents