Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Gradebook API

From MoodleDocs
Revision as of 07:23, 17 January 2012 by Andrew Davis (talk | contribs)

Overview

This document explains how custom additions to Moodle may make use of the Gradebook API to read and write student grades.

The Gradebook API allows you to read and write from the gradebook. It also allows you to provide an interface for detailed grading information.

File Locations

Functions

The main file of interest for the gradebook API is /lib/gradelib.php

Examples

/mod/xxx/grade.php

gradebook callbacks in /mod/xxx/lib.php

$modinstance->modname.'_update_grades'; Get module to update all grade items

$modinstance->modname.'_grade_item_update'; Create/update grade item for given activity module instance

What is the difference between these methods exactly? Both are required by lib/gradelib.php grade_update_mod_grades() which calls both of them but all our implementations of %modname%_update_grades() just seem to call %modname%_grade_item_update(). Are we updating the grade twice for every call to grade_update_mod_grades()?