From: tjhunt Date: Tue, 13 Mar 2007 16:27:24 +0000 (+0000) Subject: Entity decoding only done the right number of times on import, not once too often. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0c6b4d2e81728bbefb826f4c9ce347333aae6d44;p=moodle.git Entity decoding only done the right number of times on import, not once too often. Also, fix a notice and and Eclipse warning. --- diff --git a/question/format/xml/format.php b/question/format/xml/format.php index 86a298f29a..611245f435 100755 --- a/question/format/xml/format.php +++ b/question/format/xml/format.php @@ -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 { * */ 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; } }