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

Grading page fails to load grading data if opened in a background tab in Firefox



    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8.5
    • Fix Version/s: None
    • Component/s: JavaScript
    • Affected Branches:


      Reproduction steps:

      1. Create a graded assignment and have a submission sent. Submission type and grading type do not matter.
      2. As teacher role, open "View all submissions" page for that assignment.
      3. Make sure your browser is configured not to immediately switch to the newly created tab.
      4. Ctrl-Click "Grade" button to open grading page in a background tab. Make sure that "View all submissions" page remains your current active tab.
      5. a) Switch to the new tab immediately. Observe that both submission author information and submission grading form are loaded properly, which is expected behaviour.
        b) Repeat step 4 but wait ~10 seconds before switching to the new tab. In my case, submission author information will be loaded, but grading form will be absent. Instead only a loading indicator will be present, that never resolves.
      6. Reloading the page fixes the issue if the tab is active during first couple of seconds. However, if you hit reload and switch to another tab immediately, issue is reproduced.

      I am able to reproduce it both while working over Internet and while working in the same local network as Moodle instance in question. As such, I find it unlikely to be a connection issue.

      Factors that do not appear to affect the bug:

      • Simple/Advanced grading
      • File/Text submission type

      I've been able to consistently reproduce the issue on two instances of Firefox 81 (with all extensions disabled), but it does not appear to affect IE11 or Chrome. I currently don't have any other browsers installed to check there.

      In the developers console there are no errors, but Network tab shows something interesting.

      Normally grading page queries following functions of server.php (in order):

      1. mod_assign_list_participant
      2. core_user_set_user_preferences
      3. core_fetch_notifications
      4. mod_assign_get_participant
      5. core_get_fragment

      When the issue is reproduced, last query is completely absent.

      Suspected reason is Firefox throttling scripts in background tabs (perhaps, setInterval() behaviour?), but I'm unsure how to test this, or how it could affect the grading page.


      I can confirm that the issue is related to changes in setTimeout()/setInterval() in background tabs.

      If I modify Firefox setting responsible for minimal acceptable interval (dom.min_background_timeout_value) and set it to a smaller value like 50ms (default is 1000ms), the issue is no longer reproduced.




            Unassigned Unassigned
            the-vindicar the-vindicar
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            0 Vote for this issue
            2 Start watching this issue