-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
4.0.6, 4.1.1
-
MOODLE_400_STABLE, MOODLE_401_STABLE
Steps to reproduce issue
- Enable debugging (Debug messages: DEVELOPER; Display debug messages: Yes).
- From Site administration > Grades > Scales click Add a new scale.
- Give it a name ("Scale 1") and a scale ("Low, Medium, High") and click Save changes.
- Create course 1.
- Enrol student on course 1.
- Add an assignment to course 1:
- Give it a name.
- Under the Grade heading in the Grade field change Type to "Scale" and select "Scale 1".
- Click Save changes.
- On the course page click the Grades tab:
- For the enrolled student grade the assignment using the selected scale ("Medium").
- Click Save changes.
- Create course 2.
- From course 2 select the Grades tab and change the view to Scales using the drop-down list.
- By "Scale 1" click the edit icon (gear wheel).
- Untick Standard scale and click Save changes.
- Delete course 2.
- Go to course 1.
- In course 1 view grade book
Expected results
The grades appear without error.
Actual results
Grade average for assignment is "Error". The following error appears (ID may vary):
Incorrect scale id: 3
line 1028 of /lib/grade/grade_item.php: call to debugging()
line 843 of /lib/gradelib.php: call to grade_item->load_scale()
line 796 of /lib/gradelib.php: call to grade_format_gradevalue_real()
line 1606 of /grade/report/grader/lib.php: call to grade_format_gradevalue()
line 1254 of /grade/report/grader/lib.php: call to grade_report_grader->get_right_avg_row()
line 1270 of /grade/report/grader/lib.php: call to grade_report_grader->get_right_rows()
line 166 of /grade/report/grader/index.php: call to grade_report_grader->get_grade_table()