Permalink
Browse files

MDL-26894: merged from SCORM 1.2 (scorm_12lib.php) after an XDebug au…

…dit session
  • Loading branch information...
1 parent 56babbc commit 36c0108a2f9f7ac6168598c3ec1d3d84bf25e9f0 @scara scara committed Mar 19, 2011
Showing with 5 additions and 2 deletions.
  1. +1 −1 mod/scorm/datamodels/scorm_12lib.php
  2. +4 −1 mod/scorm/datamodels/scorm_13lib.php
@@ -313,7 +313,7 @@ function scorm_get_toc($user,$scorm,$cmid,$toclink=TOCJSLINK,$currentorg='',$sco
}
if ($play) {
- // it is possible that scoid is still not set, in this case we dont want an empty object
+ // 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);
}
@@ -207,7 +207,10 @@ function scorm_get_toc($user,$scorm,$cmid,$toclink=TOCJSLINK,$currentorg='',$sco
}
if ($play) {
- $sco = $DB->get_record('scorm_scoes', array('id'=>$scoid));
+ // 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->previd = $previd;
$sco->nextid = $nextid;
$result->sco = $sco;

0 comments on commit 36c0108

Please sign in to comment.