MDL-47260 core_grades: Prevent notices when setting up other aggregation method

This partially reverts:

- 4927c3ff (MDL-47011)
- 6484d460 (MDL-47055)

Part of: MDL-46576