Gradebook

 
 
Picture of Constance Horne
Date a course was completed (v2.4)
 

I am creating SQL to export final grades for completed courses.

Where can I find the date a course was completed by a student?

Picture of Kimber Warden
Re: Date a course was completed (v2.4)
 

Try prefix_course_completions.timecompleted

Picture of Constance Horne
Re: Date a course was completed (v2.4)
 

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.username
, 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