]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10916 - Import and Export of Cloze question misses out "generalfeedback" column...
authortjhunt <tjhunt>
Mon, 24 Sep 2007 14:17:23 +0000 (14:17 +0000)
committertjhunt <tjhunt>
Mon, 24 Sep 2007 14:17:23 +0000 (14:17 +0000)
question/format/xml/format.php

index e4826b3f7e1c23a6e7ebc10189b08e9289c77163..dfd2506f57f07e68f47fd1afebcf32b3c0fd729e 100755 (executable)
@@ -203,6 +203,7 @@ class qformat_xml extends qformat_default {
         // 'header' parts particular to multianswer
         $qo->qtype = MULTIANSWER;
         $qo->course = $this->course;
+        $qo->generalfeedback = $this->getpath( $questions, array('#','generalfeedback',0,'#','text',0,'#'), '', true );
 
         if (!empty($questions)) {
             $qo->name = $this->import_text( $questions['#']['name'][0]['#']['text'] );
@@ -802,11 +803,15 @@ class qformat_xml extends qformat_default {
             // for Cloze type only
             $name_text = $this->writetext( $question->name );
             $question_text = $this->writetext( $question->questiontext );
+            $generalfeedback = $this->writetext( $question->generalfeedback );
             $expout .= "  <question type=\"$question_type\">\n";
             $expout .= "    <name>$name_text</name>\n";
             $expout .= "    <questiontext>\n";
             $expout .= $question_text;
             $expout .= "    </questiontext>\n";
+            $expout .= "    <generalfeedback>\n";
+            $expout .= $generalfeedback;
+            $expout .= "    </generalfeedback>\n";
         }
 
         if (!empty($question->options->shuffleanswers)) {