When using whole forum grading with a rubric or grading guide that is not set up, the following exception is thrown:
Exception - Call to a member function get_controller() on null
Error code: generalexceptionmessage
line 147 of \grade\grading\form\rubric\classes\grades\grader\gradingpanel\external\fetch.php: Error thrown
line 131 of \grade\grading\form\rubric\classes\grades\grader\gradingpanel\external\fetch.php: call to gradingform_rubric\grades\grader\gradingpanel\external\fetch::get_fetch_data()
line 261 of \lib\externallib.php: call to gradingform_rubric\grades\grader\gradingpanel\external\fetch::execute()
line 81 of \lib\ajax\service.php: call to external_api::call_external_function()
Steps to reproduce:
- Create a forum and a post to grade.
- Open the forum and Edit Settings > Whole forum grading > Grading method > Rubric
- The Advanced grading page appears. Note the alert at the bottom: "Please note: the advanced grading form is not ready at the moment. Simple grading method will be used until the form has a valid status."
- Return to the forum and click the "Grade users" button.
- The above exception appears.
According to the note on the Advanded grading page, the rubric should default back to the Simple grading method if it is not set up, but that doesn't appear to happen. At the very least, a proper error message should appear informing the user to adjust their grading method before proceeding with whole forum grading.