Add entry in Moodle gradebook manually

Re: Add entry in Moodle gradebook manually

by Marcus Green -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Do you mean you want to write PHP code that directly updates the Moodle gradebook?

If so my experience is that it is quite complex involving creating an instance of the grade_item class and

calling its  methods.

e.g. 

$gradeitem = new grade_item(array('id' => $gradeitemid, 'courseid' => $courseid));
$gradeitem->someMethodCall($param,$param,$param)

My function for doing something like that had about 75 lines of code in it.