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

Disable sorting on unsortable columns in SCORM reports

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.8
    • Component/s: SCORM
    • Labels:

      Description

      In the SCORM basic/interaction/objective reports, the 'checkbox' column is sortable which means a (hidden) link is included in the table heading.

      If this link is followed (either by a spider or screen reader), it gives a database error:

      Error reading from database

      More information about this error

      Debug info: ERROR: column "checkbox" does not exist
      LINE 1: ...userid IS NOT NULL OR st.userid IS NULL) ORDER BY checkbox A...
      ^
      SELECT DISTINCT '' || u.id || '#' || COALESCE(st.attempt, 0) AS uniqueid, st.scormid AS scormid, st.attempt AS attempt, u.id AS userid,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.idnumber FROM mdl_user u LEFT JOIN mdl_scorm_scoes_track st ON st.userid = u.id AND st.scormid = 1 WHERE u.id IN ($1,$2) AND (st.userid IS NOT NULL OR st.userid IS NULL) ORDER BY checkbox ASC, lastname DESC LIMIT 20 OFFSET 0
      [array (
      0 => 4,
      1 => 3,
      )]
      Error code: dmlreadexception
      Stack trace:
      line 451 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 239 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 744 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 349 of /mod/scorm/report/basic/report.php: call to pgsql_native_moodle_database->get_records_sql()
      line 85 of /mod/scorm/report.php: call to scorm_basic_report->display()

      The attached patch removes sorting on the checkbox column, and also from the picture column which also doesn't make sense to be sorted (the column heading is blank so you can't sort by it anyway).

        Attachments

          Activity

            People

            Assignee:
            simoncoggins Simon Coggins
            Reporter:
            simoncoggins Simon Coggins
            Peer reviewer:
            Dan Marsden
            Integrator:
            Sam Hemelryk
            Tester:
            Andrew Nicols
            Participants:
            Component watchers:
            Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/Nov/14