The problem with grade_create_category() is that it breaks the idea that modules should not know about the gradebook implementation. Direct access to grade categories might cause problems later.
- add idnumber to grade categories
- add new parameter to grade_update $category=null which would specify requested category idnumber, name and aggregation
We should not IMHO use category id /internal implementation) or name (might change) - the id could solve the identification problem
- remove grade categories from API - modules could not specify them
- use new "Grading" tab in module editing page - similar to roles overrides; mods would not know about this code, teachers could administer all grade items attached to mod there