MDL-45323 grade: Fix query errors on grade_get_grade_for_activity method.
MDL-45323 grade: Unit test for grade_get_grade_items_for_activity()