MDL-15859 [PATCH] Fixes for tests of '' on Oracle. Backport 1.9.

This commit is contained in:
piers
2008-08-20 23:06:37 +00:00
parent 88ba1fda5e
commit ff915d6056
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -494,7 +494,7 @@ function scorm_grade_item_update($scorm, $grades=NULL) {
$params = array('itemname'=>$scorm->name, 'idnumber'=>$scorm->cmidnumber);
if (($scorm->grademethod % 10) == 0) { // GRADESCOES
if ($maxgrade = count_records_select('scorm_scoes',"scorm='$scorm->id' AND launch<>''")) {
if ($maxgrade = count_records_select('scorm_scoes',"scorm='$scorm->id' AND launch<>'".sql_empty()."'")) {
$params['gradetype'] = GRADE_TYPE_VALUE;
$params['grademax'] = $maxgrade;
$params['grademin'] = 0;
+2 -2
View File
@@ -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);
}
+3 -3
View File
@@ -358,7 +358,7 @@ function scorm_grade_user_attempt($scorm, $userid, $attempt=1, $time=false) {
$grademethod = $scorm->grademethod % 10;
foreach ($scoes as $sco) {
if ($userdata=scorm_get_tracks($sco->id, $userid,$attempt)) {
if ($userdata = scorm_get_tracks($sco->id, $userid, $attempt)) {
if (($userdata->status == 'completed') || ($userdata->status == 'passed')) {
$attemptscore->scoes++;
}
@@ -474,7 +474,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) {
@@ -630,7 +630,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 ($scoes && (count($scoes) == 1)) {
if ($scorm->skipview >= 1) {