Gradebook API
From MoodleDocs
The Gradebook API allows you to read and write from the gradebook. It also allows you to provide an interface for detailed grading information.
/lib/gradelib.php
/mod/xxx/grade.php
gradebook callbacks in /mod/xxx/lib.php