Quantcast
Channel: My Experience with Web
Viewing all articles
Browse latest Browse all 18

Moodle fetch Student Grades

$
0
0

Hi,

To fetch student’s grade from Moodle database you can use this query

 

SELECT u.firstname AS `First Name` , u.lastname AS `Last Name` , u.email AS Email, c.idnumber AS `Course Acronym` , c.fullname AS Course, ROUND( gg.finalgrade, 2 ) Grades, u.city AS City, u.country AS Country, FROM_UNIXTIME( gi.timemodified ) `Grading Date`
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
WHERE gi.courseid = c.id
AND gi.itemtype = ‘course’
AND c.idnumber IN (‘C101′, ‘C102′, ‘C103′, ‘C104′, ‘C105′)

ORDER BY c.idnumber

 

Cheers

Jaswant



Viewing all articles
Browse latest Browse all 18

Trending Articles