-
Bug
-
Resolution: Fixed
-
Major
-
2.4.1
-
MOODLE_24_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE
-
master_
MDL-37524 -
Easy
-
In mod/scorm/player.php line #136, the $mode ('normal', 'review', or 'browse') is an argument to scorm_get_toc:
$result = scorm_get_toc($USER, $scorm, $cm->id, TOCJSLINK, $currentorg, $scoid, $mode, $attempt, true, true);
However, $mode isn't actualy set until nine lines later:
if (($trackdata->status == 'completed') || ($trackdata->status == 'passed') || ($trackdata->status == 'failed'))
By the time $mode is set, the loadSCO.php URL has already been stashed in the toc title attribute by scorm_get_toc, so it's too late. The mode=review isn't passed to loadSCO.php and cmi.mode isn't set correctly.
The attached patch re-calls scorm_get_toc if $mode=review nine lines later.
Also in the patch are two other minor and self-explanatory fixes for places $mode isn't passed.