Affects Version/s: 2.8.9, 2.9.3, 3.0.1
- Use Oracle
- Add a SCORM package
- Set in Attempts management Last completed attempt
- Push Save and Display
- (Regressions) Test the above steps with all the other supported DBs
Affected Branches:MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
Fixed Branches:MOODLE_29_STABLE, MOODLE_30_STABLE
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
1) Add a SCORM package
2) Set in Attempts management “Last completed attempt”
3) Push Save and Display
Using Oracle you’ll get “Error reading from database”.
This error is due to this query in mod/scorm/locallib.php (function scorm_get_last_completed_attempt):
$sql = "SELECT MAX(attempt)
WHERE userid = ? AND scormid = ?
AND (value='completed' OR value='passed')";
because value is a CLOB.
The solution is to correct the query in this way
- AND (value='completed' OR value='passed')";
+ AND (".$DB->sql_order_by_text('value')."='completed' OR ".$DB->sql_order_by_text('value')."='passed')";