MDL-15859 - [PATCH] Fixes for tests of '' on Oracle.$DB->sql_empty() changes.

This commit is contained in:
piers 2008-08-21 21:22:23 +00:00
parent 600be0625e
commit 5b4b959b5a
3 changed files with 4 additions and 4 deletions

View File

@ -512,7 +512,7 @@ function scorm_grade_item_update($scorm, $grades=NULL) {
}
if (($scorm->grademethod % 10) == 0) { // GRADESCOES
if ($maxgrade = $DB->count_records_select('scorm_scoes', 'scorm = ? AND launch <> ?', array($scorm->id, ''))) {
if ($maxgrade = $DB->count_records_select('scorm_scoes', 'scorm = ? AND launch <> ?', array($scorm->id, $DB->sql_empty()))) {
$params['gradetype'] = GRADE_TYPE_VALUE;
$params['grademax'] = $maxgrade;
$params['grademin'] = 0;

View File

@ -40,7 +40,7 @@
if ($sco = scorm_get_sco($scoid)) {
if ($sco->launch == '') {
// Search for the next launchable sco
if ($scoes = $DB->get_records_select('scorm_scoes',"scorm = ? AND launch <> ? AND id > ?",array($scorm->id, '', $sco->id), 'id ASC')) {
if ($scoes = $DB->get_records_select('scorm_scoes',"scorm = ? AND launch <> ? AND id > ?",array($scorm->id, $DB->sql_empty(), $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 = $DB->get_records_select('scorm_scoes',"scorm = ? AND launch <> ?", array($scorm->id, ''),'id ASC');
$scoes = $DB->get_records_select('scorm_scoes',"scorm = ? AND launch <> ?", array($scorm->id, $DB->sql_empty()),'id ASC');
$sco = current($scoes);
}

View File

@ -623,7 +623,7 @@ function scorm_simple_play($scorm,$user) {
$result = false;
$scoes = $DB->get_records_select('scorm_scoes', 'scorm = ? AND launch <> ?', array($scorm->id, ''));
$scoes = $DB->get_records_select('scorm_scoes', 'scorm = ? AND launch <> ?', array($scorm->id, $DB->sql_empty()));
if ($scoes && (count($scoes) == 1)) {
if ($scorm->skipview >= 1) {