From: gbateson Date: Sat, 3 Feb 2007 00:36:18 +0000 (+0000) Subject: omit empty answers from JQuiz import X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9d45b55ad0e14d89147d9eb719bad7808a9a4acd;p=moodle.git omit empty answers from JQuiz import --- diff --git a/question/format/hotpot/format.php b/question/format/hotpot/format.php index db33a3c3c3..fe4c2544c9 100644 --- a/question/format/hotpot/format.php +++ b/question/format/hotpot/format.php @@ -433,9 +433,12 @@ class qformat_hotpot extends qformat_default { $fraction = 1; } } - $question->fraction[] = $fraction; - $question->feedback[] = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['feedback'][0]['#']")); - $question->answer[] = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['text'][0]['#']")); + $answertext = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['text'][0]['#']")); + if ($answertext!='') { + $question->answer[] = $answertext; + $question->fraction[] = $fraction; + $question->feedback[] = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['feedback'][0]['#']")); + } $a++; } $questions[] = $question;