Blind Marking - Participant ID Changes

Blind Marking - Participant ID Changes

by Tom Cole -
Number of replies: 5

Hi folks,

I deliver eLearning and Moodle support for Robert Gordon University and have come across a blind marking query I can't get my head around.

The examiner has downloaded all the papers that students have submitted for offline marking, all of which are distinguished by their blind marking IDs. When he comes to bulk-upload them back into Moodle, however, he finds that some of the Participant IDs don't match. Very strange. 

In most cases, the participant IDs increase by 1 but there are some cases of students' participant IDs increasing by 30+ in this dropbox. I guess this is Moodle searching for the next available participant ID in the sequence? 

At first I thought this was perhaps because the students had reuploaded their papers and therefore gained a new participant ID but the logs reveal none of the students have uploaded papers a second time. 

Has anybody encountered this problem before? Any advice on how to prevent the participant IDs changing in future dropboxes?

Average of ratings: -
In reply to Tom Cole

Re: Blind Marking - Participant ID Changes

by Michael Hughes -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Yes!

If I recall correctly there is a potential for a race condition that leads to there being 2 Blind participant IDs for the same user. Both IDs should work to tie back to the same user but it's disconcerting and only 1 of the IDs is displayed.
In reply to Michael Hughes

Re: Blind Marking - Participant ID Changes

by Michael Hughes -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
I *think* what can happen is that, when a blind ID is needed for the first time (e.g. generating the 1st user in the grading table for the assignment for the first time), allocated_unique_ids() gets run to generate *all* of the unique ids.

However there's no locking that goes on to prevent a 2nd request also asking for a blind id or a user, and if that user is different to ^^ or ^^ hasn't been generated yet, then it will also generate a unique ID for all of the unallocated users, which could also be "all" of the users.

So now when both requests finish allocate_unique_ids() has been called twice.

But it's also a very small timing window, but I think it really comes from the fact that the initial unique ids are only generated when they are first needed (as far as I can tell on a "view" of assignment pages), rather than being generated as early as possible (so for instance when the activity is saved).
In reply to Michael Hughes

Re: Blind Marking - Participant ID Changes

by Tom Cole -
Hi Michael, thanks for the quick reply! I suppose it might be a case of the request timing out as you say.
 
Attached is a screenshot of the student's submission as seen by the the examiner. It lists Participant 1439114 but, when the examiner clicks Grade and when he downloads the submissions, he gets 1439110. Uploading his feedback into Moodle as 1439110 doesn't seem to be matching with the 1439114 participant either. 

Participant_1439146 has become 1439174 
Participant_1439110 has become 1439114
Participant_1439079 has become 1439080

Does this number increase sequentially for the next number in the queue or is it random? Since it's a blind marking dropbox, the examiner is worried he has given feedback to the wrong students if the participant IDs can change. The IDs wouldn't change once generated, would they?
Attachment Blind Marking Participant ID Changes.png
In reply to Tom Cole

Re: Blind Marking - Participant ID Changes

by Michael Hughes -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
The IDs aren't changing, but it seems that there end up being 2 ids pointing to the same user and there's an inconsistency as to which one is pulled out (probably because it didn't expect to ever end up with more than 1 record per user per assignment).
In reply to Tom Cole

Re: Blind Marking - Participant ID Changes

by Michael Hughes -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
The participant number is sequential, in that it is just the primary key of the table, so it's guaranteed unique, but 2 processes adding records to the table at the same time could end up being interleaved.