Browse files

MDL-20185 detect zero, "0", as an answer for a gap in a JCloze when i…

…mporting to the Moodle's question bank / Quiz module
  • Loading branch information...
1 parent 1572c44 commit 613064589168257875494d1269f9d0aaacb227d0 gbateson committed Aug 31, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 question/format/hotpot/format.php
View
2 question/format/hotpot/format.php
@@ -187,7 +187,7 @@ function process_jcloze(&$xml, &$questions) {
$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

0 comments on commit 6130645

Please sign in to comment.