Permalink
Browse files

MDL-14967 Upgrade all code using DML - fixed missing changes in scorm…

…_get_scoes
  • Loading branch information...
1 parent b748c97 commit b44c704f0551e19277c4be6c21a823d194ef05af bobopinna committed Aug 21, 2008
Showing with 7 additions and 4 deletions.
  1. +7 −4 mod/scorm/locallib.php
View
@@ -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));
}
-?>
+?>

0 comments on commit b44c704

Please sign in to comment.