From 9d45b55ad0e14d89147d9eb719bad7808a9a4acd Mon Sep 17 00:00:00 2001 From: gbateson Date: Sat, 3 Feb 2007 00:36:18 +0000 Subject: [PATCH] omit empty answers from JQuiz import --- question/format/hotpot/format.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.39.5