From 1f1c60c6a755b2aa43943a63eccdd70eba8fcb8b Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Wed, 15 Jun 2011 12:27:45 +0100 Subject: [PATCH] MDL-27797 supplimental. Fix two minor issues found by Sam H during testing. --- question/format/xml/format.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/question/format/xml/format.php b/question/format/xml/format.php index 7c6dbda2436..c0658be50ac 100644 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -414,6 +414,8 @@ class qformat_xml extends qformat_default { * @return object question object */ public function import_multianswer($questions) { + question_bank::get_qtype('multianswer'); + $questiontext = array(); $questiontext['text'] = $this->import_text($questions['#']['questiontext'][0]['#']['text']); $questiontext['format'] = '1'; @@ -438,7 +440,7 @@ class qformat_xml extends qformat_default { $qo->questiontext = $qo->questiontext['text']; $qo->questiontextformat = ''; - $this->import_hints($qo, $question, true); + $this->import_hints($qo, $questions, true); return $qo; } @@ -909,6 +911,12 @@ class qformat_xml extends qformat_default { $qo = $this->import_essay($question); } else if ($questiontype == 'calculated') { $qo = $this->import_calculated($question); + } else if ($questiontype == 'calculatedsimple') { + $qo = $this->import_calculated($question); + $qo->qtype = 'calculatedsimple'; + } else if ($questiontype == 'calculatedmulti') { + $qo = $this->import_calculated($question); + $qo->qtype = 'calculatedmulti'; } else if ($questiontype == 'category') { $qo = $this->import_category($question); @@ -1250,8 +1258,7 @@ class qformat_xml extends qformat_default { $expout .= " {$question->options->single}\n"; $expout .= " " . $question->options->answernumbering . "\n"; - $expout .= " " . - $this->writetext($question->options->shuffleanswers, 3) . + $expout .= " " . $question->options->shuffleanswers . "\n"; $component = 'qtype_' . $question->qtype;