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

Flaw in attempt page update, breaks some attempts, huge performance hit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.3.2
    • 2.3.1
    • Quiz
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • Hide

      1. Attempt a multi-page quiz as a student.

      2. From some page in the middle, click 'Finish attempt...'

      3. Then click 'Return to attempt' and make sure you go back to the page you were on.

      4. If you can be bothered, look directly in the DB, and verify that quiz_attempts.currentpage is only being changed for the current attempt, not for all attempts!

      Show
      1. Attempt a multi-page quiz as a student. 2. From some page in the middle, click 'Finish attempt...' 3. Then click 'Return to attempt' and make sure you go back to the page you were on. 4. If you can be bothered, look directly in the DB, and verify that quiz_attempts.currentpage is only being changed for the current attempt, not for all attempts!

      New logic was added in 2.3 that sets the attempt page if it doesn't match, but the updates happens unconditionally, so all attempt pages are set to the page of the current attempt, which then means every other attempt will do this too when visited, causing a vicious cycle.

      On large sites, this means that you have a very large update whenever and attempt is done. On postgres, this causes tons of dead records (we had over 20 million, they were being made faster than vaccum could keep up). The updates would cause the attemps to timeout, because it was updating so many records. The fix is to include the missing parameters for the set_field call in mod/quiz/attempt.php

            timhunt Tim Hunt
            emerrill Eric Merrill
            Dan Poltawski Dan Poltawski
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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