From: gbateson Date: Fri, 27 Oct 2006 00:53:24 +0000 (+0000) Subject: fix detection and display of fixed items in JMatch (jmt file) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c81aa39f921a9755428b72f0f398040f942ad58d;p=moodle.git fix detection and display of fixed items in JMatch (jmt file) --- diff --git a/mod/hotpot/template/v6.php b/mod/hotpot/template/v6.php index ae78f14d6f..4ce607414a 100644 --- a/mod/hotpot/template/v6.php +++ b/mod/hotpot/template/v6.php @@ -420,14 +420,21 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default { $options = ''; foreach ($r_keys as $key) { - $options .= ''."\n"; + if (empty($r_items[$key]['fixed'][0]['#'])) { + $options .= ''."\n"; + } } $str = ''; foreach ($l_keys as $key) { $str .= ''.$l_items[$key]['text'][0]['#'].''; - $str .= ''; - $str .= ''; + $str .= ''; + if (empty($r_items[$key]['fixed'][0]['#'])) { + $str .= ''; + } else { + $str .= $r_items[$key]['text'][0]['#']; + } + $str .= ''; } return $str; } @@ -717,7 +724,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default { $str .= "D[$i] = new Array();\n"; $str .= "D[$i][0] = '".$this->js_safe($item['text'][0]['#'], true)."';\n"; $str .= "D[$i][1] = ".($i+1).";\n"; - $str .= "D[$i][2] = 0;\n"; + $str .= "D[$i][2] = '".$this->int_value($item['fixed'][0]['#'])."';\n"; } return $str; }