Module dealing with multiple grades

Module dealing with multiple grades

by Oliver Rahs -
Number of replies: 3
Hi there

I'm writing a new moodle-activity that integrates an external mathematical tool. The grades of the tool will be transfered into the gradebook.
The new activity has got multiple grades per student. I don't understand how to store these grades in different columns of the gradebook. I found a description here http://docs.moodle.org/en/Development:Grades under "Dealing with multiple Grades", but don't know how to use it.

Does someone know how to do it? The assignment-activity seems to do that already, but i can't find the right place in the code. When I know how to do it, I will also extend the documentation.

Thanks,
Oliver
In reply to Oliver Rahs

Re: Module dealing with multiple grades

by Oliver Rahs -
As I understand it, we should use the grade_update() of the new grade API to enter grades and grade_items to the gradebook.

But how can I insert multiple grade_items in the gradebook for one module?

Is it handled with $iteminstance, $itemnumber and/or the $idnumber-parameter of the method? Or do I have to create manually a grade_category for my module first?

I'm grateful for any help
Oliver
In reply to Oliver Rahs

Re: Module dealing with multiple grades

by Nicolas Connault -
Multiple grade_items are handled with the itemnumber variable, and a category will be created (automatically I think) named after your module.

example
category name = activity name
item1: iteminstance = 1; itemnumber = 1;
item2: iteminstance = 1; itemnumber = 2;

This isn't very well documented yet, it should get remedied soon (i'm not saying it will..)
In reply to Nicolas Connault

Re: Module dealing with multiple grades

by Oliver Rahs -
Hi Nicolas
It works perfect with the $itemnumber, thanks.
I've copied your example in the Development:Grades-Document, hope that's alright.