Gradebook

 
 
Picture of Gary Lynch
Re: Grade Exports
 

HI All

I tried to modify the query to this

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

JOIN mdl_user u on u.id = g.userid

JOIN mdl_quiz c on c.id = g.quiz

JOIN mdl_quiz_grades a on a.id = 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

thanks

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?

Thanks!

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 , u.email
, cc.name CourseName,
ROUND(gg.finalgrade,2) Grade,
FROM_UNIXTIME(gi.timemodified) TimeModified
FROM mdl_course AS c
JOIN mdl_context AS ctx ON c.id = ctx.instanceid
JOIN mdl_role_assignments AS ra ON ra.contextid = ctx.id
JOIN mdl_user AS u ON u.id = ra.userid
JOIN mdl_grade_grades AS gg ON gg.userid = u.id
JOIN mdl_grade_items AS gi ON gi.id = gg.itemid
JOIN mdl_course_categories AS cc ON cc.id = c.category
WHERE gi.courseid = c.id AND gi.itemtype = 'course'

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