From 9d759a0e85e8da8b0ba9aa796ee9fcbf404b457e Mon Sep 17 00:00:00 2001 From: csantossaenz Date: Thu, 12 Apr 2007 10:28:51 +0000 Subject: [PATCH] Fixed problem with scorm_get_sco to connect with the API when there is no data in the scorm_scoes_data table. --- mod/scorm/locallib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 78ae088fb8e..10c4ca20e08 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -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 {