General developer forum

Bulk reading of grade_items & grade_grades - impact of needsupdate column?

 
 
Picture of Patrick a
Re: Bulk reading of grade_items & grade_grades - impact of needsupdate column?
 

So is it safe to assume that I will never encounter an issue where a Grade_item is set "NeedsUpdate = 1", if the Course Item isn't set as well?

 

So when I'm manually kicking off the regrade() function, I only need to do it for grade_items that are type grade_item.itemtype = "course" ?

 
Average of ratings: -
Picture of Bob Puffer
Re: Bulk reading of grade_items & grade_grades - impact of needsupdate column?
Group Particularly helpful MoodlersGroup Testers

If a grade_item's needsupdate flag is set you'll get 'error' in the cell on the grader report.

 
Average of ratings: -
Picture of Aharon Ben-Shemer
Re: Bulk reading of grade_items & grade_grades - impact of needsupdate column?
 

I'm out of my depth here, but if all I want is to get the final grade of a student whose ID I have in a course whose ID I have, is there no way to call some one method that will do any and all recalsulatoins needed and return me the score? It seems kind of incredible that there is no higher level call that could be made.

Excuse any ignorance betrayed by the above...

Aharon

 
Average of ratings: -
Picture of Bob Puffer
Re: Bulk reading of grade_items & grade_grades - impact of needsupdate column?
Group Particularly helpful MoodlersGroup Testers

Download my LAE Grader and look in locallib.php. You'll find some functions that are pretty close to what you want (probably accuratepointsprelimcalculation()). Modify as needed.

 
Average of ratings: -
Picture of Aharon Ben-Shemer
Re: Bulk reading of grade_items & grade_grades - impact of needsupdate column?
 

Thank you!

May I ask one more question: if I rely on your plugin to do all the calculations and updating of the final grades so that the extraction of the final grades to the SIS is done AFTER that process, would I be correct looping through the table mdl_grade_grades and just pulling out the finalgrade value in the rows where the itemid leads back to an itemtype of 'course' (in mdl_grade_items) ? It looks like that might be enough to identify and extract final grades for export to an SIS, no?

If the above is possible, then I guess I would just want to make sure that the grades are "accurate" before I pull them out. I guess I am not sure what that means or whether it needs to be triggered in some way, but I will try to figure it out by looking through the ReadMe text file and the plugin code. Unless you have a one sentence summary you could share here... smile Or perhaps for my purposes this scheme would work even if the regular grades module were used without your plugin? Is there some big problem I missed?

Thank you for your help.

 
Average of ratings: -
Picture of Bob Puffer
Re: Bulk reading of grade_items & grade_grades - impact of needsupdate column?
Group Particularly helpful MoodlersGroup Testers

We don't change any data in the moodle tables, calculations are made on the fly so you can't rely on what's stored in grade_grades, its likely a percentage of the whole.

 
Average of ratings: -