I'm working with Moodle database and I want to get all grades from an unenrolled user.
The purpose is to print all final grades in the user profile.
I tryed to get the data from mdl_grade_grades_history and mdl_grade_items_history databases,
but the final result is strange and incoherent, cause I have no grade history for a user id=832 who was enrolled in the course id=102
Here's an example of the sql :
SELECT distinct gg.rawgrade, gg.rawgrademax, gg.finalgrade, gi.itemname
FROM moodle_cifad.mdl_grade_grades_history gg
INNER JOIN moodle_cifad.mdl_grade_items_history gi ON gg.itemid = gi.id
where gg.userid = 832 and gi.courseid = 102
Has anyone an idea, am i on the right path ?