Errors after deleting grade categories

Errors after deleting grade categories

David Conrad -
Колькасьць адказаў: 6

Greetings - we're running Moodle v3.0.2; For one course, the grade book was not calculating correctly. A category was not totaling, so a colleague created a new category and moved the items that were within the erroneous one. This seemed to resolved the issue. we deleted the old category, however, as soon as we did so the grade book became inaccessible. 

I ran debugging, here are the main results:

  • Attempt to obtain a grade_category's associated grade_item without the category's ID being set.
  • Can not regrade non existing category
  • Can not update grade object, no id!

Is this normal behavior for a gradebook to break after deleting some empty categories?

siteurl/grade/edit/tree/index.php?id=123 gives "isn't working message"

Attempted to get to edit category pages by adjusting the courseid/categoryid in another course's page, but this brings up a page showing the course title and the breadcrumb, with everything else blank. 

I'll have to move forward with a restore, but either my colleague didn't actually move all the items out of the categories before deleting them, or there is a major flaw with deleting categories. 

У адказ на David Conrad

Re: Errors after deleting grade categories

Emma Richardson -
Выява Documentation writers Выява Particularly helpful Moodlers Выява Plugin developers

My guess would be that the category was not empty.  As for it not calculating, do you have your site set to block editing of category totals?  The teacher probably overrode the category total at some point and that will stop it from calculating automatically.

У адказ на Emma Richardson

Re: Errors after deleting grade categories

David Conrad -

Emma, thank you for your response. I have a hunch you're right about the category. I tested the theory in a test course, and deleted a category that contained a graded activity. Deleting the category moved the activity up to the parent category, and did not break the gradebook. 

У адказ на David Conrad

Re: Errors after deleting grade categories

Emma Richardson -
Выява Documentation writers Выява Particularly helpful Moodlers Выява Plugin developers
У адказ на Emma Richardson

Re: Errors after deleting grade categories

David Conrad -

Hi again. Yes, I posted the debugging results in my initial post. Here they are again: 

  • Attempt to obtain a grade_category's associated grade_item without the category's ID being set.
  • Can not regrade non existing category
  • Can not update grade object, no id!
There were several thousand of these, one for each student's grades. 


I'm still working on getting the back up in place so I can restore the course. Currently the instructor/students have no way to access the gradebook. 

У адказ на David Conrad

Re: Errors after deleting grade categories

David Conrad -

This happened again on another instance with moodle v3.0.3. I checked the logs and see that the instructor deleted several grade items. They may have been a manual items, itemmodule mhaairs (McGraw Hill w/ grade sync). 


Debugging shows the following:

  • Can not update grade object, no id!
  • Can not regrade non existing category
  • Attempt to obtain a grade_category's associated grade_item without the category's ID being set. 


I don't think the gradebook should be inaccessible when you delete a few grade items. I'll have to pull another backup so we can restore back to the date when the items were deleted.