From: gbateson Date: Mon, 31 Aug 2009 01:36:01 +0000 (+0000) Subject: MDL-20185 detect zero, "0", as an answer for a gap in a JCloze when importing to... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=489a7b243fd23605049e16829414df6e346e4a53;p=moodle.git MDL-20185 detect zero, "0", as an answer for a gap in a JCloze when importing to the Moodle's question bank / Quiz module --- 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