Affects Version/s: 2.5
Fix Version/s: None
Component/s: Block: AJAX Marking
Steps to reproduce:
1) Enroll 10 students in a class
2) pick one these 10 students at random and have them submit an assignment in the class.
3) teacher sees new submission in ajax marking and clicks to bring up the grading pup-up.
Now, the grading popup may report that there is already a grade in the gradebook and report a seemingly random number, or say that the grade is overridden in the gradebook.
In my investigations, I have found that what was happening was that ajax marking was reporting the grades for the user enrolled in the course with the lowest userid (database ID number in mdl_user table). I think this is because large parts of the assign module seem to have been refactored/rewritten in 2.5.
My proposed fix is:
on or about line 290 replace:
$pagination = array('rownum' => 0, 'useridlist' => array($params['userid']), 'last' => 0);
$pagination = array('rownum' => 0, 'userid' => $params['userid'], 'useridlist' => array($params['userid']), 'last' => 0);