Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
1.7.1, 1.8
-
None
-
unicode is recommended to be installed/enabled OK
database postgres version 7.4 is required and you are running 7.4.16 OK
php version 4.3.0 is required and you are running 4.3.9 OK
php_extension iconv is recommended to be installed/enabled OK
php_extension mbstring is recommended to be installed/enabled Check
unicode is recommended to be installed/enabled OK database postgres version 7.4 is required and you are running 7.4.16 OK php version 4.3.0 is required and you are running 4.3.9 OK php_extension iconv is recommended to be installed/enabled OK php_extension mbstring is recommended to be installed/enabled Check
-
PostgreSQL
-
MOODLE_17_STABLE, MOODLE_18_STABLE
-
MOODLE_18_STABLE, MOODLE_19_STABLE
Description
Symptoms:
When launching a freshly added SCORM 2004 package it will go straight to the SCORM Player (showing the contents of the first SCO), it does not go to the SCORM Entry page where it lists the table of content and the options such as Browse, Review, Enter Course...
The first time you run the SCORM package it appears to work pretty normally, but if you complete the SCORM and go back to Review it you will receive messages from the SCO that it cannot find the API Adapter (SCO Generated Messages), this is because it is not there.
If you then go to Admin/Server/Debugging and set the level to developer you will receive the following messages.
ERROR: zero-length delimited identifier at or near """" at character 57
SELECT * FROM mdl_scorm_scoes WHERE scorm=1 AND launch""
ERROR: invalid input syntax for type bigint: ""
SELECT scorm FROM mdl_scorm_scoes WHERE id = ''
ERROR: syntax error at or near "AND" at character 63
SELECT * FROM mdl_scorm_scoes_track WHERE userid=2 AND scoid= AND attempt=1 ORDER BY element ASC
The first message is the important one, the other errors are created as a result of the first error.
The problem is that Postgres doesn't like the double quotes for (launch<>""), changing the double quote for escaped single quotes appears to solve the problem (launch<>\'\')
I think this is also ok for MySQL but I haven't had chance to check.
Below is a snippet from the modified locallib.php file which corrects the problem.
file: moodle/mod/scorm/locallib.php
function scorm_simple_play($scorm,$user) {
$result = false;
$scoes = get_records_select('scorm_scoes','scorm='.$scorm->id.' AND launch<>\'\'');
if (count($scoes) == 1) {
if ($scorm->skipview >= 1) {
$sco = current($scoes);
if (scorm_get_tracks($sco->id,$user->id) === false)
else if ($scorm->skipview == 2)
{ header('Location: player.php?a='.$scorm->id.'&scoid='.$sco->id); $result = true; } }
}
return $result;
}
This appears to still be a problem in 1.8 in the stable branch at least, but I haven't checked this in detail.
One the database error was resolved with the code change mentioned the SCORM packages then behaved correctly, the user would be presented with the SCORM Entry page where they could chose to Browse, Review, Enter the course.