Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-52683

SCORM Last completed attempt causes Error reading from database (ORACLE)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.9, 2.9.3, 3.0.1
    • Fix Version/s: 2.9.5, 3.0.3
    • Component/s: SCORM
    • Labels:

      Description

      Steps
      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)
      FROM

      {scorm_scoes_track}

      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')";

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Mar/16