MDL-28603 SCORM fix regression with ADL scorm 1.2 tests

This commit is contained in:
Dan Marsden
2011-08-12 17:25:59 +12:00
parent 9d228de05a
commit aa1e13ed2e
+3 -6
View File
@@ -1276,9 +1276,6 @@ function scorm_get_toc($user,$scorm,$cmid,$toclink=TOCJSLINK,$currentorg='',$sco
$usertracks = array();
foreach ($scoes as $sco) {
if (!empty($sco->launch)) {
if (empty($scoid)) {
$scoid = $sco->id;
}
if ($usertrack = scorm_get_tracks($sco->id,$user->id,$attempt)) {
if ($usertrack->status == '') {
$usertrack->status = 'notattempted';
@@ -1452,10 +1449,10 @@ function scorm_get_toc($user,$scorm,$cmid,$toclink=TOCJSLINK,$currentorg='',$sco
}
if ($play) {
if (empty($scoid)) {
$scoid = reset($scoes)->id;
// it is possible that $scoid is still not set, in this case we don't want an empty object
if ($scoid) {
$sco = scorm_get_sco($scoid);
}
$sco = scorm_get_sco($scoid);
$sco->previd = $previd;
$sco->nextid = $nextid;
$result->sco = $sco;