Permalink
Browse files

fix detection and display of fixed items in JMatch (jmt file)

  • Loading branch information...
1 parent 5d0fc5c commit c81aa39f921a9755428b72f0f398040f942ad58d gbateson committed Oct 27, 2006
Showing with 11 additions and 4 deletions.
  1. +11 −4 mod/hotpot/template/v6.php
View
15 mod/hotpot/template/v6.php
@@ -420,14 +420,21 @@ function v6_expand_MatchDivItems() {
$options = '<option value="x">'.$this->parent->xml_value('data,matching-exercise,default-right-item').'</option>';
foreach ($r_keys as $key) {
- $options .= '<option value="'.$key.'">'.$r_items[$key]['text'][0]['#'].'</option>'."\n";
+ if (empty($r_items[$key]['fixed'][0]['#'])) {
+ $options .= '<option value="'.$key.'">'.$r_items[$key]['text'][0]['#'].'</option>'."\n";
+ }
}
$str = '';
foreach ($l_keys as $key) {
$str .= '<tr><td class="LeftItem">'.$l_items[$key]['text'][0]['#'].'</td>';
- $str .= '<td class="RightItem"><select id="s'.$key.'_'.$key.'">'.$options.'</select></td>';
- $str .= '<td></td></tr>';
+ $str .= '<td class="RightItem">';
+ if (empty($r_items[$key]['fixed'][0]['#'])) {
+ $str .= '<select id="s'.$key.'_'.$key.'">'.$options.'</select>';
+ } else {
+ $str .= $r_items[$key]['text'][0]['#'];
+ }
+ $str .= '</td><td></td></tr>';
}
return $str;
}
@@ -717,7 +724,7 @@ function v6_expand_DragArray() {
$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;
}

0 comments on commit c81aa39

Please sign in to comment.