Global chat and multiple exercises at the same time
This is minor as a student isn't supposed to be taking several tests at the same time, but I'm registering it in order to find a patch at some point.
The original task for this was #5272, which required the implementation of a mechanism to block the global chat while a student is taking an exam.
It was implemented using $_SESSION[current_exercises] => Array (  =>  => 1  =>  => ) as a form of storing the different "ongoing" attempts at exercises. If one of the current_exercises elements has a value of 1, then it is assumed the student is still taking an exam and cannot chat yet.
I managed to get to the [current_exercises] => Array (  =>  => 1  =>  => ) situation while having finished all my exams this way:
- created exam 1 in course AAA
- created exam 1 in course BBB
- registered student to both courses AAA and BBB
- The student opens 2 tabs, one in course AAA, and starts exam 1, one in course BBB, and starts exam 1 there too
- The student finishes exam AAA.1
- The student then goes out of BBB.1 before finishing (he clicks somewhere on the breadcrumb) and comes back to the exam BBB.1
- The student finishes exam BBB.1
- The student has now finished both exams, but the chat is still not available. [current_exercises] => Array (  =>  => 1  =>  => ) indicates that there was an unfinished attempt and, when re-entering the exercise, it was considered as a new attempt (not the same one)