]> git.mjollnir.org Git - moodle.git/commitdiff
Entity decoding only done the right number of times on import, not once too often.
authortjhunt <tjhunt>
Tue, 13 Mar 2007 16:27:24 +0000 (16:27 +0000)
committertjhunt <tjhunt>
Tue, 13 Mar 2007 16:27:24 +0000 (16:27 +0000)
Also, fix a notice and and Eclipse warning.

question/format/xml/format.php

index 86a298f29a96a5fd1ebeeae0252af6e47a04a72a..611245f4351b70fb87a6bfb6ebfa69b2273e4a15 100755 (executable)
@@ -72,7 +72,6 @@ class qformat_xml extends qformat_default {
      */
     function import_text( $text ) {
         $data = $text[0]['#'];
-        $data = html_entity_decode( $data );
         return addslashes(trim( $data ));
     }
 
@@ -189,8 +188,8 @@ class qformat_xml extends qformat_default {
      * @return object question object
      */
     function import_multianswer( $questions ) {
-        $qo = qtype_multianswer_extract_question($this->import_text( 
-            $questions['#']['questiontext'][0]['#']['text'] ));
+        $questiontext = $questions['#']['questiontext'][0]['#']['text'];
+        $qo = qtype_multianswer_extract_question($this->import_text($questiontext));
 
         // 'header' parts particular to multianswer
         $qo->qtype = MULTIANSWER;
@@ -449,6 +448,7 @@ class qformat_xml extends qformat_default {
      * </question>
      */
     function import_category( $question ) {
+        $qo = new stdClass;
         $qo->qtype = 'category';
         $qo->category = $question['#']['category'][0]['#'];
         return $qo;
@@ -517,6 +517,7 @@ class qformat_xml extends qformat_default {
 
             // stick the result in the $questions array
             if ($qo) {
+                $qo->generalfeedback = '';
                 $questions[] = $qo;
             }
         }