mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
MDL-15859 - [PATCH] Fixes for tests of '' on Oracle.$DB->sql_empty() changes.
This commit is contained in:
parent
600be0625e
commit
5b4b959b5a
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user