]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20185 detect zero, "0", as an answer for a gap in a JCloze when importing to...
authorgbateson <gbateson>
Mon, 31 Aug 2009 01:36:01 +0000 (01:36 +0000)
committergbateson <gbateson>
Mon, 31 Aug 2009 01:36:01 +0000 (01:36 +0000)
question/format/hotpot/format.php

index 379a1461864e65754d63c238901ca5c7cff59e97..e701b5a955b7522838edd99601bfb592bb3d1230 100644 (file)
@@ -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