From b44c704f0551e19277c4be6c21a823d194ef05af Mon Sep 17 00:00:00 2001 From: bobopinna Date: Thu, 21 Aug 2008 07:32:19 +0000 Subject: [PATCH] MDL-14967 Upgrade all code using DML - fixed missing changes in scorm_get_scoes --- mod/scorm/locallib.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 8e9133f736..74e62a3ba6 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -206,15 +206,18 @@ function scorm_get_sco($id,$what=SCO_ALL) { */ function scorm_get_scoes($id,$organisation=false) { + global $DB; + $organizationsql = ''; + $queryarray = array('scorm'=>$id); if (!empty($organisation)) { - $organizationsql = "AND organization='$organisation'"; + $queryarray['organization'] = $organisation; } - if ($scoes = $DB->get_records_select('scorm_scoes',"scorm='$id' $organizationsql order by id ASC")) { + if ($scoes = $DB->get_records('scorm_scoes', $queryarray, 'id ASC')) { // drop keys so that it is a simple array as expected $scoes = array_values($scoes); foreach ($scoes as $sco) { - if ($scodatas = $DB->get_records('scorm_scoes_data','scoid',$sco->id)) { + if ($scodatas = $DB->get_records('scorm_scoes_data',array('scoid'=>$sco->id))) { foreach ($scodatas as $scodata) { $sco->{$scodata->name} = stripslashes_safe($scodata->value); } @@ -1010,4 +1013,4 @@ function scorm_get_count_users($scormid, $groupingid=null) { return ($DB->count_records_sql($sql, $params)); } -?> \ No newline at end of file +?> -- 2.39.5