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

dmlreadexception error on close of quiz attempt

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.0.3
    • Fix Version/s: None
    • Component/s: Quiz
    • Labels:
    • Environment:
      Apache version 2.2.17
      PHP version 5.2.17
      MySQL version 5.0.92-community
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      This is a course that originated in 1.9; when a student in a group takes a quiz I get the following SQL error. The quiz was not limited to that group - "no separate groups" was selected for that quiz. I've tested this every which way - if the student takes the quiz while not a part of a group, there's no dmlreadexception error. If the student is a part of a group, the error shows up; whether or not the quiz is assigned to that group.

      The tracing ends on trying to send email notification on quiz submission - but email subscription to forums is working.

      I have a similar course that I built with a restore of the course that has the problem – the error does not occur for a student in a group.

      Show
      This is a course that originated in 1.9; when a student in a group takes a quiz I get the following SQL error. The quiz was not limited to that group - "no separate groups" was selected for that quiz. I've tested this every which way - if the student takes the quiz while not a part of a group, there's no dmlreadexception error. If the student is a part of a group, the error shows up; whether or not the quiz is assigned to that group. The tracing ends on trying to send email notification on quiz submission - but email subscription to forums is working. I have a similar course that I built with a restore of the course that has the problem – the error does not occur for a student in a group.
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Using Moodle 2.0.3+ Build 20110525

      Debug info: 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 u.id <> '47'
      ORDER BY u.lastaccess' at line 8
      SELECT u.id, u.username, u.firstname, u.lastname, u.email, u.lang, u.timezone, u.mailformat, u.maildisplay
      FROM mdl_user u
      JOIN (SELECT DISTINCT userid
      FROM mdl_role_assignments
      WHERE contextid IN (1,3,20,89)
      AND roleid IN (3,4)
      ) ra ON ra.userid = u.id
      WHERE u.deleted = 0 AND u.id <> ? AND (u.id IN (SELECT userid FROM mdl_groups_members gm WHERE gm.groupid = ?) OR u.id IN ()) AND u.id <> ?
      ORDER BY u.lastaccess
      [array (
      0 => '1',
      1 => 31,
      2 => '47',
      )]

      Stack trace:

      • line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown
      • line 794 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      • line 5097 of /lib/accesslib.php: call to mysqli_native_moodle_database->get_records_sql()
      • line 1129 of /mod/quiz/locallib.php: call to get_users_by_capability()
      • line 881 of /mod/quiz/attemptlib.php: call to quiz_send_notification_emails()
      • line 191 of /mod/quiz/processattempt.php: call to quiz_attempt->quiz_send_notification_emails()

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              jerlandson Jane Erlandson
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: