turnitin / moodle-plagiarism_turnitin

Turnitin Plagiarism plugin for Moodle
http://www.turnitin.com
45 stars 65 forks source link

Students recorded as having graded themselves (intermittent) #644

Open universityofglasgow opened 1 year ago

universityofglasgow commented 1 year ago

This is a problem that I, unfortunately, have not been able to reproduce. But we have nearly 2,000 instances and grading has been done in Turnitin in each case.

The evidence looks like this in the mdl_assign_grades table...

Screenshot 2022-12-01 at 14 59 16

Note that in each case, the 'userid' matches the 'grader'. This isn't possible - none of these userids have the right to grade. They're just students (yes, we checked).

When we look at the logs, the grading time is always associated with the first time the student goes to view their Turnitin report AFTER the actual grading. So it appears to be updating the grader information not when it's actually graded but at the first view after. Looking at the code, grader is set by accessing $USER->id so it seems likely that this is being updated when the student is viewing, not the grader.

Even though I can't fully explain this, I wanted to log the problem as it clearly exists and might be useful to others.

mhughes2k commented 1 year ago

Is it possible the students are just going to get their grades before TII's scheduled tasks have been able to pull them back over?

mhughes2k commented 1 year ago

https://github.com/turnitin/moodle-plagiarism_turnitin/blob/ba1632ea5a156da847c6c3d6d35e0e7e9f4d10dd/lib.php#L1560

Looks a little bit suspicious....I'm not sure under any circumstance that you can assert the grader of the assignment is $USER unless you've checked that the process running is actually a grader, but in any case, if the process was being run by the "cron" this is going to set the grader to being the system user.

Also considering that this function seems to be callable also by the ajax.php?action=update_grade

Which would seem to be called by open_viewer.js (in checkDVClosed()) presumably to allow the student to view their TII submission, so from a cursory glance would then be updating the score with $USER being the student (who's viewing the page) and not the grader who actually did it...

But some one please check my working...

mhughes2k commented 1 year ago

I think this is also again related to Turnitin's unwillingness to utilise any of the Moodle APIs for interacting with the assignment (see #496)

universityofglasgow commented 1 year ago

I've looked at the $USER thing a lot and while I can't explain exactly why it's wrong I know I don't like it at all. As @mhughes2k says, relying on the current user in the session doesn't seem like a very good idea when you have all sorts of asynchronous stuff going on.

I also think your analysis of the open_viewer.js is probably spot on.

mhughes2k commented 1 year ago

It's not "wrong" per se, it's the right way to do things if you're wanting the "current" user, but in this case it's completely the wrong person to be doing something that's relating to grades.

If there's a situation where the user grading in TII isn't a Moodle user in the class then I can see a question about who the recorded grader is, but otherwise the plugin (even if it is using the student viewing the document to trigger the update) should be identifying the TII user that did the grading in TII, mapping it back on to the relevant Moodle (Teacher) user within the class site as the grader.

Or at worst it should be the "admin" user.

eclectics commented 8 months ago

We have the same error using plugin v3.5 2023033001, despite there being a fix noted about overwriting grades under 2022092101

From what I can see, if the instructure uses Grademark to mark the assignment, the student can click on the pencil icon in moodle to look at the instructors grading (even though it flows through to moodle). But clicking on the pencil icon overwrites the userid and the date in the assign_grades table in moodle. Clearly, this should only happen if the instructor has actually updated the grade or feedback; it should never happen as a result of student action.

There doesn't seem to be a way in moodle to turn off the grademark option for students (other than disabling it completely-- which is what we've done).

Luckily the change doesn't trigger updates to the gradebook, so we still have the correct data, but if the student looks at the assignment page, it looks like they've marked themselves. Our auditors won't be impressed.

sumaiyamannan commented 1 month ago

Kia ora, I have provided a fix for this issue in #707

Regards, Sumaiya