From 537515d8e82eead3c86149b417fd176c19d0ad0c Mon Sep 17 00:00:00 2001 From: gbateson Date: Fri, 27 Oct 2006 01:34:08 +0000 Subject: [PATCH] fixed detection and display of fixed JMatch items (in jmt files) --- mod/hotpot/template/v6.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/mod/hotpot/template/v6.php b/mod/hotpot/template/v6.php index ae78f14d6fd..4ce607414a8 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; }