Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-28603 SCORM fix regression with ADL scorm 1.2 tests

  • Loading branch information...
commit ee124f531b18bad5661842b872a46505ba054496 1 parent 3a5778e
@danmarsden danmarsden authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 mod/scorm/locallib.php
View
9 mod/scorm/locallib.php
@@ -1277,9 +1277,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';
@@ -1453,10 +1450,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;
Please sign in to comment.
Something went wrong with that request. Please try again.