Overhaul quizaccess_onesession quiz access rule

Overhaul quizaccess_onesession quiz access rule

by Luca Bösch -
Number of replies: 2

I feel you are waiting here for something, Kasia.

I was too, because I forgot about this requirement I heard people talking about some days ago, but it came back to me right now.

quizaccess_onesession lets restrict one quiz attempt to being able to be done only from one browser session. That hinders you to start a quiz, then having your expert continuing it from another device.

It turns out that disabling this in the case of need (whoever wants to emphasize the use case better than me please do comment!) is quite cumbersome. Therefore quizaccess_onesession cannot really be recommended to everyday (non expert) lecturers. One such event happening could be: a net outage happens, then the net returns. Then everyone wants to continue their attempts. But due to the fact, maybe, that they had to log in again, the sessions have changed. Now everyone is blocked. Another use case: a client crashes, no restart possible and even if possible it would be another browser session.

Target:
Overhaul that quiz access rule. User friendliness ("Select all" is maybe missing? Sorry for my ignorance, I'm not a power user.). "Quick solution" in case need be.

It might be useful to contact the maintainer beforehand and offering help/ask of his consent.

Best,
Luca

In reply to Luca Bösch

Re: Overhaul quizaccess_onesession quiz access rule

by Antonia Bonaccorso -
Hi Luca,

I am doing support for exams for years now so i have quite a clear vision on how I would like this plugin to work.

Let me first shortly explain what it does on a not very technical level: If SSO is enabled on your Moodle instance, one user may have several sessions open. These sessions interact, but they exist in parallel. This is something you don't want to have for exams, so quizaccess_onesession restricts the access for one user to one unique session. So far, everthing is fine.

Now there are legitimate cases where your student needs a new session. For example, when her device does no longer work and she needs a new one. Or when she lost the network shortly and now that network access is back, accesses the quiz with a new ip and hence a new session.

When logging in on the new device or after recovering access to the network, the student is blocked. A teacher can resolve this by granting the student a second session. When the teacher does this, the first session (on the faulty device/prior to the lost network episode) is terminated and only the new, second session is valid. For a single student this scenario works.

Now imagine you have an exam with 300 students in several room. One room looses network for a short time, than it comes back. As a teacher now you have to grant a second session for each student individually. This is cumbersome. And it becomes even mored difficult, as the second session will be available one after another. So the first student may resume working quickly after the network connection was lost whereas the second student will start working maybe 10min later. If you want to be fair, each of them needs an individual time adjustment and each of them will leave your room at different times - creating a lot of noise for those still working.

And now imagine, it was not only one room, but all 300 students were affected.

I think a good way to hndle this "grant second session" would be a user or group override as we know it for example for time adjustments. And if the whole group is affected, I would love to see this possibility in the quiz settings. So similar to granting all 300 students a second attempt on an exam by adjusting the quiz settings accordingly, I could grant all of them a second session.

Best,
Antonia
In reply to Antonia Bonaccorso

Re: Overhaul quizaccess_onesession quiz access rule

by Alistair Spark -

We did something similar about giving all students extra time while taking into account of all existing user and group overrides & only applying it to the exam sitting that is currently in progress (e.g. if exam hall is too small, some students may take exam in the morning, the other half of the class take it the afternoon etc and if disruption happens in the morning only they should get the extra time). Sharing in case some of the code can be reused to help you with this:

  • https://blogs.ucl.ac.uk/digital-education/2025/05/09/moodle-exam-guard-update/
  • https://github.com/ucl-isd/moodle-local_examguard/pull/5
  • https://github.com/ucl-isd/moodle-local_examguard/pull/6