MDL-47398 core_grades: fix grade category generator