mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +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) {
|
||||
$tags = 'data,matching-exercise,pair';
|
||||
$i = 0;
|
||||
while(
|
||||
($l_item = $this->parent->xml_value('data,matching-exercise,pair',"[$i]['#']['left-item'][0]['#']")) &&
|
||||
($r_item = $this->parent->xml_value('data,matching-exercise,pair',"[$i]['#']['right-item'][0]['#']"))
|
||||
) {
|
||||
$l_items[] = $l_item;
|
||||
$r_items[] = $r_item;
|
||||
while($item = $this->parent->xml_value($tags,"[$i]['#']['left-item'][0]['#']")) {
|
||||
if (!empty($item['text'][0]['#'])) {
|
||||
$l_items[] = $item;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$i = 0;
|
||||
while($item = $this->parent->xml_value($tags,"[$i]['#']['right-item'][0]['#']")) {
|
||||
if (!empty($item['text'][0]['#'])) {
|
||||
$r_items[] = $item;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue