Merge branch 'master_MDL-51757' of git://github.com/danmarsden/moodle

This commit is contained in:
Dan Poltawski 2015-12-01 09:50:59 +00:00 committed by Eloy Lafuente (stronk7)
commit 3c2f70aeb6
2 changed files with 15 additions and 10 deletions

View File

@ -1108,7 +1108,7 @@ function scorm_seq_flow_tree_traversal($activity, $direction, $childrenflag, $pr
}
// Returns the next activity on the tree, traversal direction, control returned to the LTS, (may) exception.
function scorm_seq_flow_activity_traversal ($activity, $userid, $direction, $childrenflag, $prevdirection, $seq, $userid) {
function scorm_seq_flow_activity_traversal ($activity, $userid, $direction, $childrenflag, $prevdirection, $seq) {
$parent = scorm_get_parent ($activity);
if (!isset($parent->flow) || ($parent->flow == false)) {
$seq->deliverable = false;
@ -1123,7 +1123,7 @@ function scorm_seq_flow_activity_traversal ($activity, $userid, $direction, $chi
if ($skip) {
$seq = scorm_seq_flow_tree_traversal($activity, $direction, false, $prevdirection, $seq, $userid, $skip);
$seq = scorm_seq_flow_activity_traversal($seq->nextactivity, $userid, $direction,
$childrenflag, $prevdirection, $seq, $userid);
$childrenflag, $prevdirection, $seq);
} else if (!empty($seq->identifiedactivity)) {
$seq->nextactivity = $activity;
}
@ -1147,10 +1147,10 @@ function scorm_seq_flow_activity_traversal ($activity, $userid, $direction, $chi
} else {
if ($direction == 'backward' && $seq->traversaldir == 'forward') {
$seq = scorm_seq_flow_activity_traversal($seq->identifiedactivity, $userid,
'forward', $childrenflag, 'backward', $seq, $userid);
'forward', $childrenflag, 'backward', $seq);
} else {
$seq = scorm_seq_flow_activity_traversal($seq->identifiedactivity, $userid,
$direction, $childrenflag, null, $seq, $userid);
$direction, $childrenflag, null, $seq);
}
return $seq;
}
@ -1174,7 +1174,7 @@ function scorm_seq_flow ($activity, $direction, $seq, $childrenflag, $userid) {
return $seq;
} else {
$activity = $seq->nextactivity;
$seq = scorm_seq_flow_activity_traversal($activity, $userid, $direction, $childrenflag, null, $seq, $userid);
$seq = scorm_seq_flow_activity_traversal($activity, $userid, $direction, $childrenflag, null, $seq);
return $seq;
}
}

View File

@ -421,7 +421,8 @@ function scorm_seq_choice_sequencing($sco, $userid, $seq) {
}
if ($seq->currentactivity === $sco) {
break;
// MDL-51757 - this part of the SCORM 2004 sequencing and navigation was not completed.
throw new \coding_exception('Unexpected state encountered');
}
$sib = scorm_get_siblings($seq->currentactivity);
@ -451,7 +452,8 @@ function scorm_seq_choice_sequencing($sco, $userid, $seq) {
return $seq;
}
}
break;
// MDL-51757 - this part of the SCORM 2004 sequencing and navigation was not completed.
throw new \coding_exception('Unexpected state encountered');
}
if ($seq->currentactivity == null || $seq->currentactivity == $comancestor) {
@ -478,7 +480,8 @@ function scorm_seq_choice_sequencing($sco, $userid, $seq) {
return $seq;
}
}
break;
// MDL-51757 - this part of the SCORM 2004 sequencing and navigation was not completed.
throw new \coding_exception('Unexpected state encountered');
}
if ($comancestor->id == $sco->id) {
@ -504,7 +507,8 @@ function scorm_seq_choice_sequencing($sco, $userid, $seq) {
}
}
}
break;
// MDL-51757 - this part of the SCORM 2004 sequencing and navigation was not completed.
throw new \coding_exception('Unexpected state encountered');
}
if (array_search($ancestors, $comancestor) !== false) {
@ -589,7 +593,8 @@ function scorm_seq_choice_sequencing($sco, $userid, $seq) {
}
}
}
break;
// MDL-51757 - this part of the SCORM 2004 sequencing and navigation was not completed.
throw new \coding_exception('Unexpected state encountered');
}
if (scorm_is_leaf ($sco)) {