MDL-32888 Grader report: Refined SESSION and api function use