- Create a graded assignment and have a submission sent. Submission type and grading type do not matter.
- As teacher role, open "View all submissions" page for that assignment.
- Make sure your browser is configured not to immediately switch to the newly created tab.
- Ctrl-Click "Grade" button to open grading page in a background tab. Make sure that "View all submissions" page remains your current active tab.
- 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.
- 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):
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.