The function you're looking for is fill_tables. I think its in the grade/report/user/lib.php file.
Gradebook
Manipulate final grade with PHP for conversion
This discussion has been locked so you can no longer reply to it.