My site consists of 13 courses and apporximately 500 users. Most users are enrolled in all courses. Is there a way to obtain a report that shows all courses, and all users indicating their quiz score? Currently I have to download a grader report from each individual course.
Run this query.
SELECT c.shortname AS shortname, CONCAT(mu.firstname, ' ', mu.lastname) AS fullname, gg.finalgrade AS finalgrade
FROM mdl_grade_items AS gi
INNER JOIN mdl_course c ON c.id = gi.courseid
LEFT JOIN mdl_grade_grades AS gg ON gg.itemid = gi.id
INNER JOIN mdl_user AS mu ON gg.userid = mu.id
WHERE gi.itemtype = 'course'
ORDER BY c.id asc
This will give you the short name of the course they're enrolled in, their fullname, and the associated final grade for everyone in your system.