Permalink
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 6a77e4c commit 8fbc9739017a8fb526e386817530c641c3a56aa7 gbateson committed Aug 31, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 question/format/hotpot/format.php
@@ -188,7 +188,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 8fbc973

Please sign in to comment.