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

Pages during a quiz attempt should not be cached, so forwards/back do not lead to errors

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.7.6, 3.8.3, 3.9, 3.9.4, 3.10.1
    • 3.9.5, 3.10.2
    • Quiz
    • MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MDL-68970_311
    • Hide
      1. Log in as a teacher/admin.
      2. Create a new quiz, set a time limit (e.g. 10 mins).
      3. Add two true-false questions, and ensure one is on page 1 and one on page 2. (Question types does not matter, but TF is quick to create).
      4. Log out,
      5. Log in as a student.
      6. Start an attempt at the quiz.
      7. On page 1, click Next page.
      8. Wait a bit, e.g. until the timer is down to 9 minutes.
      9. Click the back button in the browser.
      10. Verify that Page 1 reloads as you get back to it. (One way to do this is to see that the timer starts counting from where it had got to, not 10 mins. Also, watching what the browser does closely. Browser developer tools may also help.)
      Show
      Log in as a teacher/admin. Create a new quiz, set a time limit (e.g. 10 mins). Add two true-false questions, and ensure one is on page 1 and one on page 2. (Question types does not matter, but TF is quick to create). Log out, Log in as a student. Start an attempt at the quiz. On page 1, click Next page. Wait a bit, e.g. until the timer is down to 9 minutes. Click the back button in the browser. Verify that Page 1 reloads as you get back to it. (One way to do this is to see that the timer starts counting from where it had got to, not 10 mins. Also, watching what the browser does closely. Browser developer tools may also help.)

    Description

      During a quiz attempt, if the user navigates using the browser's forwards of back buttons, then they may end up with a question shown in their browser which is in a state that is out-of-synch with the current state on the server. Also, the timer may show the wrong time (at least until auto-save runs and fixes it, as in MDL-58926).

      Therefore, it would be best if, navigating using browser back or forwards during a quiz attempt, the page is forced to reload (as in https://stackoverflow.com/a/43399649/1292707 or similar).

      Note, this might be useful generic functionality. Therefore, probabably the way to implement this is a core JS module core/reloader, and then quiz attempt.php does $PAGE->requires->js_call_amd('core/reloader', 'force_reload_on_history_nav');

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              timhunt Tim Hunt
              Mahmoud Kassaei Mahmoud Kassaei
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Janelle Barcega Janelle Barcega
              Tim Hunt, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Kevin Percy, Laurent David, Mathew May, Mihail Geshoski, Raquel Ortega, Sabina Abellan, Sander Bangma, Sara Arjona (@sarjona), Shamim Rezaie
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                8/Mar/21

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 20 minutes
                  1h 20m