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

Quiz autosave does not detect if you lose your session

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.6.4, 2.7.1
    • 2.5.6, 2.6.3, 2.7
    • Quiz
    • MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • Hide
      1. (Optional) Add $CFG->forced_plugin_settings = array('quiz' => array('autosaveperiod' => 3)); to your config.php to make thes easier to test. (Just a 3 second delay between a change and an auto-save.)
      2. Create a quiz containing one question, e.g. one truefalse.
      3. Attempt the quiz, and Open the console. (The autosave code outputs useful debug messages to tell you what is going on - assuming you have developer debug on.)
      4. Change the answer to the truefalse question, and wait for the Autosave to run. Verify that the ajax request succeeds.
      5. Use your browser's developer tools to change the value of the sesskey hidden input in the main quiz form.
      6. Wait for the Autosave to run. Note that it appears to succeed (note that the change to the hidden input value is enough to trigger it).
      7. Verify that the red 'You have lost your connection to the server' message appears at the top of the browser window.
      Show
      (Optional) Add $CFG->forced_plugin_settings = array('quiz' => array('autosaveperiod' => 3)); to your config.php to make thes easier to test. (Just a 3 second delay between a change and an auto-save.) Create a quiz containing one question, e.g. one truefalse. Attempt the quiz, and Open the console. (The autosave code outputs useful debug messages to tell you what is going on - assuming you have developer debug on.) Change the answer to the truefalse question, and wait for the Autosave to run. Verify that the ajax request succeeds. Use your browser's developer tools to change the value of the sesskey hidden input in the main quiz form. Wait for the Autosave to run. Note that it appears to succeed (note that the change to the hidden input value is enough to trigger it). Verify that the red 'You have lost your connection to the server' message appears at the top of the browser window.

      Because of MDL-38846, when you lose your login session, the quiz auto-save code does not detect it, and so does not warn you. Hence you can lose a lot of work.

      To reproduce

      1. (Optional) Add $CFG->forced_plugin_settings = array('quiz' => array('autosaveperiod' => 3)); to your config.php to make thes easier to test. (Just a 3 second delay between a change and an auto-save.)
      2. Create a quiz containing one question, e.g. one truefalse.
      3. Attempt the quiz, and Open the console. (The autosave code outputs useful debug messages to tell you what is going on - assuming you have developer debug on.)
      4. Use your browser's developer tools to change the value of the sesskey hidden input.
      5. Change the answer to the truefalse question, and wait for the Autosave to run. Note that it appears to succeed.
      6. Click next. Notice that you get a sesskey error.

      At the penultimate step above, the red connection error should appear at the top of the page.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Andrew Lyons Andrew Lyons
            Damyon Wiese Damyon Wiese
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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