Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.9.7, 3.0.6, 3.1.1, 3.2
-
Component/s: Assignment
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE
-
Fixed Branches:MOODLE_30_STABLE, MOODLE_31_STABLE
-
Pull from Repository:
-
Pull Master Branch:wip-
MDL-55505-master -
Pull Master Diff URL:
Description
Steps to replicate (as described by our client):
- Student submits assignment for marking.
- Trainer adds feedback to attempt, but, forgets to add a grade. Reopens assignment for student to submit a second attempt.
- Student submits second attempt.
- Trainer grades second attempt 100 out of 100 and adds feedback to student to say they have passed.
- Trainer notices that the first attempt does not have a grade so edits the first attempt and adds the missing grade of 50 out of 100.
- ISSUE – Second attempt grade now has changed to 50 out of 100 and feedback from first attempt has overwritten second. Essentially the grade and feedback on the second attempt is lost and replaced with the data just added to attempt one.
- ISSUE – Attempt one still has no grade and same feedback as the data gets written to attempt two. No way to edit or change attempt one and second attempt data is lost.
I was able to track the issue down and apply a following patch, which helped.
--- a/mod/assign/locallib.php
|
+++ b/mod/assign/locallib.php
|
@@ -6719,7 +6719,7 @@ class assign {
|
protected function apply_grade_to_user($formdata, $userid, $attemptnumber) {
|
global $USER, $CFG, $DB;
|
|
- $grade = $this->get_user_grade($userid, true, $attemptnumber);
|
+ $grade = $this->get_user_grade($userid, ($formdata->attemptnumber == -1), $attemptnumber);
|
$originalgrade = $grade->grade;
|
$gradingdisabled = $this->grading_disabled($userid);
|
$gradinginstance = $this->get_grading_instance($userid, $grade, $gradingdisabled);
|