From 489a7b243fd23605049e16829414df6e346e4a53 Mon Sep 17 00:00:00 2001 From: gbateson Date: Mon, 31 Aug 2009 01:36:01 +0000 Subject: [PATCH] MDL-20185 detect zero, "0", as an answer for a gap in a JCloze when importing to the Moodle's question bank / Quiz module --- question/format/hotpot/format.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/question/format/hotpot/format.php b/question/format/hotpot/format.php index 379a146186..e701b5a955 100644 --- a/question/format/hotpot/format.php +++ b/question/format/hotpot/format.php @@ -168,7 +168,7 @@ class qformat_hotpot extends qformat_default { $text = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['text'][0]['#']")); $correct = $xml->xml_value($tags, $answer."['correct'][0]['#']"); $feedback = $this->hotpot_prepare_str($xml->xml_value($tags, $answer."['feedback'][0]['#']")); - if ($text) { + if (strlen($text)) { // set score (0=0%, 1=100%) $fraction = empty($correct) ? 0 : 1; // store answer -- 2.39.5