mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
JMatch: allow extra, unused RHS items
This commit is contained in:
parent
01a8d9bd6f
commit
d4ef3c5aaf
1 changed files with 1336 additions and 1330 deletions
|
@ -671,13 +671,19 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_jmatch_items(&$l_items, &$r_items) {
|
function get_jmatch_items(&$l_items, &$r_items) {
|
||||||
|
$tags = 'data,matching-exercise,pair';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while(
|
while($item = $this->parent->xml_value($tags,"[$i]['#']['left-item'][0]['#']")) {
|
||||||
($l_item = $this->parent->xml_value('data,matching-exercise,pair',"[$i]['#']['left-item'][0]['#']")) &&
|
if (!empty($item['text'][0]['#'])) {
|
||||||
($r_item = $this->parent->xml_value('data,matching-exercise,pair',"[$i]['#']['right-item'][0]['#']"))
|
$l_items[] = $item;
|
||||||
) {
|
}
|
||||||
$l_items[] = $l_item;
|
$i++;
|
||||||
$r_items[] = $r_item;
|
}
|
||||||
|
$i = 0;
|
||||||
|
while($item = $this->parent->xml_value($tags,"[$i]['#']['right-item'][0]['#']")) {
|
||||||
|
if (!empty($item['text'][0]['#'])) {
|
||||||
|
$r_items[] = $item;
|
||||||
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue