Where modIDs came from?

Where modIDs came from?

by Elena Ivanova -
Number of replies: 4
lost smile
We have hided calculations interface and possibility to set ID numbers from instructors completely, since we want users to be able to activate those on per-course basis.
At the moment we have 41840 grade items in the database. About 9600 of them have their idnumber field set already somehow. Something set the idnumber for those grade items to the module id number. And there are a few that have the idnumber set to the name of the grade item.
Anyone knows how those modIDs got populated, and why only for some grade items?
In reply to Elena Ivanova

Re: Where modIDs came from?

by Chad Outten -
Hi Elena,

AFAIK - you can set the grade item ID for any activity via the common module settings or if you perform a custom calculation in the GB. This might explain the inconsistency in your grade item IDs. see attached file.

Cheers, Chad
Attachment Screen_shot_2010-04-14_at_10.35.49_PM.png
In reply to Chad Outten

Re: Where modIDs came from?

by Elena Ivanova -
Hi Chad,
Thank you, but my issue is in the fact that moodle populated those ID numbers itself, and plus it made them equal to modIDs. smile
Noone had entered them manually.
I am wondering what could cause that mixed
In reply to Elena Ivanova

Re: Where modIDs came from?

by Matt Bury -
Picture of Plugin developers
Hi Elena,

I had similar issues when I was developing a grade book API for Flash and getting the SWF Activity Module to create grade items.

I couldn't find a way of getting/returning the Moodle instance ID while creating an instance of an activity module. All I could get was the module instance ID, i.e. the id column of the mdl_swf table, so I used that and left the Moodle instance ID blank. I guess that whoever coded the lib.php script for the module you're using couldn't get it either and so put the module ID in there instead.

Anyway, most Moodle scripts seem to include the option of both the Moodle ID and the module ID to identify the activity and the grade book seems to be no exception. I haven't encountered any problems with it so far.

If you find out how to get/return a Moodle instance ID when creating an instance of an activity module, I'd love to know how to do it too!

I hope this helps,

Matt smile