Permalink
Browse files

Merge branch 'm20_MDL-28603' of git://github.com/danmarsden/moodle in…

…to MOODLE_20_STABLE
  • Loading branch information...
2 parents 5a52740 + aa1e13e commit eac56e02bc30369bf3935d5eba933c6f29594d16 @stronk7 stronk7 committed Aug 15, 2011
Showing with 3 additions and 6 deletions.
  1. +3 −6 mod/scorm/locallib.php
@@ -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;

0 comments on commit eac56e0

Please sign in to comment.