I am creating SQL to export final grades for completed courses.
Where can I find the date a course was completed by a student?
Thanks. I didn't know about this table at all.
For anyone that needs an export of grades, here is what I now have:
SELECT c.id "CourseId"
, u.firstname , u.lastname , u.email, u.department
, c.shortname AS CourseName
, ROUND(gg.finalgrade,2) as Grade
, FROM_UNIXTIME(cc.timecompleted) as DateCompleted
FROM mdl_grade_items AS gi
, mdl_course c
, mdl_grade_grades AS gg
, mdl_user AS u
, mdl_course_completions as cc
WHERE gi.itemtype = 'course'
AND c.id = gi.courseid
AND gg.itemid = gi.id
AND gg.userid = u.id
and cc.userid = u.id
and cc.course = gi.courseid
and cc.timecompleted is NOT NULL
ORDER BY c.id asc