diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index 280be94c474..13d4459c299 100755 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -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; diff --git a/mod/scorm/loadSCO.php b/mod/scorm/loadSCO.php index e39ed2541c0..377d2a7e8cc 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 f70b8dea235..1a6391333bb 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -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) {