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

Unable to add multiple quiz questions, due to race condition

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 3.7.5, 3.8.2, 3.9
    • Questions, Quiz
    • None
    • MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE

      This issue has been revealed as part of MDL-67540 investigation.

      Steps to replicate:

      1. Login as an admin (session 1).
      2. Create a course.
      3. Create a quiz.
      4. Add 2 questions to question bank (`question 1` and `question 2`).
      5. In order to simulate race condition hack the code and add `sleep(2);` here: https://github.com/moodle/moodle/blob/9df4a4de18ace8fa1e02b93d6f0e572fa20ef1a2/mod/quiz/locallib.php#L2160
      6. Open another browser tab in incognito mode and login as an admin (session 2).
      7. In both sessions navigate to the quiz.
      8. Click `Edit quiz`.
      9. Click `Add` -> `From question bank`.
      10. In session 1 tick `question 1`.
      11. In session 2 tick `question 2`.
      12. In both sessions click `Add selected questions to the quiz` at the same time.
      13. Confirm, that one session adds the questions and another fails due to `mdl_quizslot_quislo_uix` constraint.

        1. Race_1.jpg
          Race_1.jpg
          137 kB
        2. Race_2.jpg
          Race_2.jpg
          150 kB

            Unassigned Unassigned
            mikhailgolenkov Misha Golenkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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