]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15473
authorthepurpleblob <thepurpleblob>
Mon, 7 Jul 2008 11:54:39 +0000 (11:54 +0000)
committerthepurpleblob <thepurpleblob>
Mon, 7 Jul 2008 11:54:39 +0000 (11:54 +0000)
Fixed typo causing the image location to be ignored if the base_64 image is not included.

Mereged from STABLE_19

question/format/xml/format.php

index dd84da0dc8fc82f4635294ca7559ef46dbf58db3..dc008f1188562603658d75a1b1bbe36666621ed7 100755 (executable)
@@ -117,7 +117,7 @@ class qformat_xml extends qformat_default {
 
     /**
      * import parts of question common to all types
-     * @param array question question array from xml tree
+     * @param $question array question question array from xml tree
      * @return object question object
      */
     function import_headers( $question ) {
@@ -132,10 +132,10 @@ class qformat_xml extends qformat_default {
         $qo->name = $this->getpath( $question, array('#','name',0,'#','text',0,'#'), '', true, $error_noname );
         $qo->questiontext = $this->getpath( $question, array('#','questiontext',0,'#','text',0,'#'), '', true );
         $qo->questiontextformat = $this->getpath( $question, array('#','questiontext',0,'@','format'), '' );
-        $image = $this->getpath( $question, array('#','image',0,'#'), $qo->image );
+        $qo->image = $this->getpath( $question, array('#','image',0,'#'), $qo->image );
         $image_base64 = $this->getpath( $question, array('#','image_base64','0','#'),'' );
         if (!empty($image_base64)) {
-            $qo->image = $this->importimagefile( $image, $image_base64);
+            $qo->image = $this->importimagefile( $qo->image, stripslashes($image_base64) );
         }
         $qo->generalfeedback = $this->getpath( $question, array('#','generalfeedback',0,'#','text',0,'#'), $qo->generalfeedback, true );
         $qo->defaultgrade = $this->getpath( $question, array('#','defaultgrade',0,'#'), $qo->defaultgrade );