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

Quiz autosave does not detect if you lose your session

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.5.6, 2.6.3, 2.7
    • Fix Version/s: 2.6.4, 2.7.1
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      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.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Jul/14