MDL-46527 grades: grade_get_grades external function rewritten
MDL-46527 grades: Fixed regression in grade_get_grades function