From e0260731dce65baa46af4833aeef0e579efac455 Mon Sep 17 00:00:00 2001 From: piers Date: Wed, 20 Aug 2008 23:15:21 +0000 Subject: [PATCH] MDL-15859 [PATCH] Fixes for tests of '' on Oracle. Backport 1.8. --- mod/scorm/lib.php | 2 +- mod/scorm/loadSCO.php | 4 ++-- mod/scorm/locallib.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index adbcd4eaf83..e6972787b33 100755 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -419,7 +419,7 @@ function scorm_grades($scormid) { } if (($scorm->grademethod % 10) == 0) { // GRADESCOES - if (!$return->maxgrade = count_records_select('scorm_scoes',"scorm='$scormid' AND launch<>''")) { + if (!$return->maxgrade = count_records_select('scorm_scoes',"scorm='$scormid' AND launch<>'".sql_empty()."'")) { return NULL; } } else { diff --git a/mod/scorm/loadSCO.php b/mod/scorm/loadSCO.php index 7f75563a50b..4dc742b9a1f 100755 --- a/mod/scorm/loadSCO.php +++ b/mod/scorm/loadSCO.php @@ -40,7 +40,7 @@ if ($sco = scorm_get_sco($scoid)) { if ($sco->launch == '') { // Search for the next launchable sco - if ($scoes = get_records_select('scorm_scoes','scorm='.$scorm->id." AND launch<>'' AND id>".$sco->id,'id ASC')) { + if ($scoes = get_records_select('scorm_scoes','scorm='.$scorm->id." AND launch<>'".sql_empty()."' AND id>".$sco->id,'id ASC')) { $sco = current($scoes); } } @@ -50,7 +50,7 @@ // If no sco was found get the first of SCORM package // if (!isset($sco)) { - $scoes = get_records_select('scorm_scoes','scorm='.$scorm->id." AND launch<>''",'id ASC'); + $scoes = get_records_select('scorm_scoes','scorm='.$scorm->id." AND launch<>'".sql_empty()."'",'id ASC'); $sco = current($scoes); } diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 47bd247c6b7..687f35d035d 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -468,7 +468,7 @@ function scorm_count_launchable($scormid,$organization='') { if (!empty($organization)) { $strorganization = " AND organization='$organization'"; } - return count_records_select('scorm_scoes',"scorm=$scormid$strorganization AND launch<>''"); + return count_records_select('scorm_scoes',"scorm=$scormid$strorganization AND launch<>'".sql_empty()."'"); } function scorm_get_last_attempt($scormid, $userid) { @@ -625,7 +625,7 @@ function scorm_view_display ($user, $scorm, $action, $cm, $boxwidth='') { function scorm_simple_play($scorm,$user) { $result = false; - $scoes = get_records_select('scorm_scoes','scorm='.$scorm->id.' AND launch<>\'\''); + $scoes = get_records_select('scorm_scoes','scorm='.$scorm->id.' AND launch<>\''.sql_empty().'\''); if (count($scoes) == 1) { if ($scorm->skipview >= 1) {