Grade Exports

Picture of Gary Lynch
Re: Grade Exports

HI All

I tried to modify the query to this

SELECT a.grade, u.username,, g.state, g.userid, g.timestart, g.timefinish, g.quiz, from mdl_quiz_attempts g

JOIN mdl_user u on = g.userid

JOIN mdl_quiz c on = g.quiz

JOIN mdl_quiz_grades a on = g.userid

two issues happen sad

The query returns 'no rows' but i have data in there (if i remove last 'join' command i get data)

also how do i intergrate from unix timestamp script into it to change dates to human readable ones?

Any help appretiated


Picture of Constance Horne
Re: Grade Exports

I also need to export all grades for all completed courses for all users along with the complion date.

Does anyone have a query that would do this?


Picture of Constance Horne
Re: Grade Exports

I finally figured out a query that appears to work on my Unix MySQL 2.4 database:

SELECT u.firstname , u.lastname ,
, CourseName,
ROUND(gg.finalgrade,2) Grade,
FROM_UNIXTIME(gi.timemodified) TimeModified
FROM mdl_course AS c
JOIN mdl_context AS ctx ON = ctx.instanceid
JOIN mdl_role_assignments AS ra ON ra.contextid =
JOIN mdl_user AS u ON = ra.userid
JOIN mdl_grade_grades AS gg ON gg.userid =
JOIN mdl_grade_items AS gi ON = gg.itemid
JOIN mdl_course_categories AS cc ON = c.category
WHERE gi.courseid = AND gi.itemtype = 'course'

You would need to change your database prefix if it is not mdl_