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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.8.9, 2.9.3, 3.0.1
    • 2.9.5, 3.0.3
    • SCORM

    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

              matteo Matteo Scaramuccia
              sara.cenni Sara Cenni
              Matteo Scaramuccia Matteo Scaramuccia
              David Monllaó David Monllaó
              Rajesh Taneja Rajesh Taneja
              Dan Marsden, Matteo Scaramuccia, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                14/Mar/16