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

Quiz closing more than 1 h after opening stops auto-saving and does not auto-submit

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-74378_401
    • MDL-74378_403
    • MDL-74378_master
      • Define a time limit instead of just setting a closing time.
      • Have students reload the page or click "Finish attempt…" and then "Return to attempt…" once there is less than one hour left.
    • Hide

       

      1. Log in as a teacher.
      2. Open a second (incognito) window and log in as a student.
      3. As the teacher, create a quiz with a single short answer question and set the closing time to ~ 1 hour 30 min from the current time. 
      4. As the student, attempt the quiz.
      5. Verify the timer does not appear at first.
      6. Write something in the input field in order for the form to be marked "dirty". Wait for the first auto-save to happen. (When using the Chrome web browser, you can enter monitor(M.mod_quiz.autosave.save_changes) in the developer console in order to be notified when an auto-save happens.)
      7. As the teacher, set the quiz's closing time to ~ 3 mins from the current time.
      8. As the student, change the input field in order for the form to be marked "dirty". Wait for the next auto-save to happen.
      9. Verify the timer appears and shows the correct time remaining.
      10. Wait for the timer to run out.
      11. Verify the quiz is submitted and finished automatically.

       

      Show
        Log in as a teacher. Open a second (incognito) window and log in as a student. As the teacher , create a quiz with a single short answer question and set the closing time to ~ 1 hour 30 min from the current time.  As the student , attempt the quiz. Verify the timer does not appear at first. Write something in the input field in order for the form to be marked "dirty". Wait for the first auto-save to happen. (When using the Chrome web browser, you can enter monitor(M.mod_quiz.autosave.save_changes) in the developer console in order to be notified when an auto-save happens.) As the teacher , set the quiz's closing time to ~ 3 mins from the current time. As the student , change the input field in order for the form to be marked "dirty". Wait for the next auto-save to happen. Verify the timer appears and shows the correct time remaining. Wait for the timer to run out. Verify the quiz is submitted and finished automatically.  

      When a quiz has no time limit, but has a closing time that is more than one hour away from the start of the attempt, no countdown timer is shown during the attempt. This is intentional behaviour. Therefore, M.mod_quiz.timer is not initialized. However, as soon as there is less than one hour left, M.mod_quiz.timer.updateEndTime() will call update() and this will fail, because the function references M.mod_quiz.timer.Y which is null. This leads to the following error:

      module.js:169 Uncaught TypeError: Cannot read properties of null (reading 'one')
          at Object.update (module.js:169:11)
          at Object.updateEndTime (module.js:190:30)
          at Object.save_done (yui_combo.php?m/-1/mod_quiz/autosave/autosave-debug.js:382:30)
          at Y.Subscriber._notify (yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13760:35)
          at Y.Subscriber.notify (yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13789:24)
          at Y.CustomEvent._notify (yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13452:17)
          at Y.CustomEvent._procSubs (yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13578:36)
          at Y.CustomEvent.fireSimple (yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13545:18)
          at Y.CustomEvent._fire (yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:13527:29)
          at IO.fire (yui_combo.php?rollup/3.18.1/yui-moodlesimple.js:14658:22)
       

      As a consequence, the module script will stop working, so from then on, no auto-save will happen and the quiz will not be auto-submitted once the time is up. (The cron job will eventually submit the quiz, but it will use the data from the last auto-save which would be ~ one hour from the end time.)

      The error does not occur if the page is reloaded due to a manual reload or a change of quiz page after there is less than one hour left.

       

      Original report

      We've had a case where teachers created a 59 question quiz with all questions on one page. The end time of the quiz was 2h 45min after its start time. Due to this 1h limit the remaining time doesn't get displayed and the quiz doesn't get automatically submitted (unless you open or reload the quiz page less than 1h before the end). Since autosaves stop happening 2 x autosaveperiod before the end of the quiz students who relied on auto-submission and didn't manually submit in time lost some of their answers.

      Is there a reason for that 1h limit? Is seems arbitrary. Getting rid of it would probably be the easiest way to fix this kind of problem.

            philippimhof Philipp Imhof
            tschroeder Tim Schroeder
            Tim Hunt Tim Hunt
            Huong Nguyen Huong Nguyen
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            9 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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