Really I am hard to get moodle enrolled and expired enrollment period of users report. I have tried many times to get this report so that I want to share you that mysql join query to run on database then get a report list with users which completed a course grade,user name,eamila ddress.

Here is the MYSQL Query:

SELECT c.shortname AS CourseName, CONCAT(mu.firstname, ‘ ‘, mu.lastname) AS fullname,mu.email as userEmailAddress, gg.finalgrade AS finalgrade
FROM mtl_grade_items AS gi
INNER JOIN mtl_course c ON c.id = gi.courseid
LEFT JOIN mtl_grade_grades_history AS gg ON gg.itemid = gi.id
INNER JOIN mtl_user AS mu ON gg.userid = mu.id
WHERE gi.itemtype = ‘course’
ORDER BY c.id asc

OUT PUT:

moodle unenroll enroll users data

I hope it is help to you. Please share your thoughts.

8355 Total Views 4 Views Today

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>