Fixed problem with scorm_get_sco to connect with the API when there is no data in the scorm_scoes_data table.

This commit is contained in:
csantossaenz 2007-04-12 10:28:51 +00:00
parent 1670305df4
commit 9d759a0e85

View File

@ -210,8 +210,11 @@ function scorm_get_sco($id,$what=SCO_ALL) {
$sco = ($what == SCO_DATA) ? new stdClass() : $sco;
if (($what != SCO_ONLY) && ($scodatas = get_records('scorm_scoes_data','scoid',$id))) {
foreach ($scodatas as $scodata) {
$sco->{$scodata->name} = $scodata->value;
$sco->{$scodata->name} = $scodata->value;
}
}
elseif (($what != SCO_ONLY) && (!($scodatas = get_records('scorm_scoes_data','scoid',$id)))){
$sco->parameters = '';
}
return $sco;
} else {