Skip to content

Commit

Permalink
MDL-15290 - Missing question types not handled properly on backup.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhunt committed Jun 18, 2008
1 parent 72c5387 commit aa0716e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions question/backuplib.php
Expand Up @@ -176,6 +176,12 @@ function backup_question($bf,$preferences,$category, $level = 4) {
$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
Expand Down

0 comments on commit aa0716e

Please sign in to comment.