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

Using the initials bars in quiz reports causes an error since MDL-59931

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 3.2.6, 3.3.3
    • 3.3.2
    • Quiz
    • MOODLE_33_STABLE
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • Hide

      This is a repeat of the testing from MDL-59931 with an extra bit.

      1. Find or create a course with at least 2 or more students, each with one or more quiz attempts. Try to have 3 attempts or more in total.
      2. Go to the quiz reports, and set the report options to Page size: 2.
      3. Verify that the paging bar shows the right number of pages.
      4. Add &tifirst=S at the end of the URL. Verify there is not a DB error.

      The above verifies that the code works normally. MDL-59931, which caused this regression, involved users having mulitple enrolments in the course. We need to ensure that fix still works, so, to extend the above testing:

      1. Log in as admin
      2. Create a second course (c2)
      3. Enable self-enrolment for that course
        1. View the course
        2. Open the edit menu (cog up the top right)
        3. Select the "more" option
        4. Select the "users" tab
        5. Click "enrolment methods"
        6. Click the little "eye" icon for self enrolment to make sure it's enabled.
      4. Log in as a student
      5. Navigate to the course and click "self enrol"
      6. Log back in as admin
      7. Navigate to the course participants page
      8. Manually enrol the student that just self enrolled into the course (this create two enrolment instances for them)
      9. Enrol some more users
      10. Repeat the first test set from above

      Try other ways to break it: collapse columns, sort by different columns (especially ones relating to a particualr question number.

      Then, repeat the testing for Quiz administration -> Results -> Responses.

      Show
      This is a repeat of the testing from MDL-59931 with an extra bit. Find or create a course with at least 2 or more students, each with one or more quiz attempts. Try to have 3 attempts or more in total. Go to the quiz reports, and set the report options to Page size: 2. Verify that the paging bar shows the right number of pages. Add &tifirst=S at the end of the URL. Verify there is not a DB error. The above verifies that the code works normally. MDL-59931 , which caused this regression, involved users having mulitple enrolments in the course. We need to ensure that fix still works, so, to extend the above testing: Log in as admin Create a second course (c2) Enable self-enrolment for that course View the course Open the edit menu (cog up the top right) Select the "more" option Select the "users" tab Click "enrolment methods" Click the little "eye" icon for self enrolment to make sure it's enabled. Log in as a student Navigate to the course and click "self enrol" Log back in as admin Navigate to the course participants page Manually enrol the student that just self enrolled into the course (this create two enrolment instances for them) Enrol some more users Repeat the first test set from above Try other ways to break it: collapse columns, sort by different columns (especially ones relating to a particualr question number. Then, repeat the testing for Quiz administration -> Results -> Responses.

      After the last update from the weekly git, the following error is occurring and we can no longer review the attempts made by our students, nor delete any which need to be removed.  The error from the debugging is here:

       

       
      [Mon Oct 02 11:30:59.064677 2017] [:error] [pid 9130] [client 98.173.56.98:10432]
      Default exception handler: Error reading from database
       
      Debug: You have an error in your SQL syntax;
      check the manual that corresponds to your MySQL server version
      for the right syntax to use near
      'AND firstname LIKE 'B%'  ESCAPE '\\\\'' at line 21
       
      SELECT COUNT(1) FROM (SELECT DISTINCT CONCAT(u.id, '#', COALESCE(quiza.attempt, 0)) AS uniqueid,
                      quiza.uniqueid AS usageid,
                      quiza.id AS attempt,
                      u.id AS userid,
                      u.idnumber, u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.firstname,u.lastname,
                      u.picture,
                      u.imagealt,
                      u.institution,
                      u.department,
                      u.email,
                      quiza.state,
                      quiza.sumgrades,
                      quiza.timefinish,
                      quiza.timestart,
                      CASE WHEN quiza.timefinish = 0 THEN null
                           WHEN quiza.timefinish > quiza.timestart THEN quiza.timefinish - quiza.timestart
                           ELSE 0 END AS duration
           FROM  mdl_user u
      LEFT JOIN mdl_quiz_attempts quiza ON
                                          quiza.userid = u.id AND quiza.quiz = ?
      JOIN mdl_user_enrolments ej1_ue ON ej1_ue.userid = u.id
      JOIN mdl_enrol ej1_e ON (ej1_e.id = ej1_ue.enrolid AND ej1_e.courseid = ?)
      WHERE quiza.preview = 0
      AND quiza.id IS NOT NULL
      AND 1 = 1
      AND u.deleted = 0
      ) temp
      AND firstname LIKE ?  ESCAPE '\\\\'
       
      [array (
        0 => '46',
        1 => '44',
        2 => 'B%',
      )]
      Error code: dmlreadexception
      * line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
      * line 1190 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      * line 1558 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
      * line 1631 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
      * line 1841 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
      * line 1589 of /lib/tablelib.php: call to moodle_database->count_records_sql()
      * line 542 of /mod/quiz/report/attemptsreport_table.php: call to table_sql->query_db()
      * line 314 of /mod/quiz/report/overview/overview_table.php: call to quiz_attempts_report_table->query_db()
      * line 1630 of /lib/tablelib.php: call to quiz_overview_table->query_db()
      * line 244 of /mod/quiz/report/overview/report.php: call to table_sql->out()
      * line 97 of /mod/quiz/report.php: call to quiz_overview_report->display()
      , referer: https://acesp.brookshireinternational.academy/mod/quiz/view.php?id=8515
      

            timhunt Tim Hunt
            drdunn858 Benjamin Dunn
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Andrew Lyons Andrew Lyons
            Ryan Wyllie Ryan Wyllie
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.