grades of un-enrolled users

grades of un-enrolled users

by michael michael -
Number of replies: 6

Hi,

is there any way to get the grades of the users after un-enrolled them,

like i want to make a grade report for all the users who attend any course in our Moodle site,and include in this report the users who already attend the courses and finish it, also the  users still enrolled.

if there are any plugins can do that,

Average of ratings: -
In reply to michael michael

Re: grades of un-enrolled users

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

As you're asking in the developer forum, I'm assuming you're happy with a solution that involves writing some code.

When a user is unenrolled, all their grades are copied into the mdl_grades_history table (from where they are restored if the user re-enrols). It should be fairly easy to write an SQL query that pull the relevant details from there.

Off the top of my head, I'm not aware of a Moodle feature or plugin that lets you directly access the mdl_grades_history table.

Average of ratings: Useful (1)
In reply to Davo Smith

Re: grades of un-enrolled users

by michael michael -

Sounds gr8,

 

But can you help me more and explain to me how we create this query? Direct in the database tables?

cuz I'm not a developer, but helping our developer, how we can solve this issue.


In reply to Davo Smith

Re: grades of un-enrolled users

by Luis de Vasconcelos -

Very useful! Thanks Davo.

When a student enrols in a course does Moodle always check the mdl_grade_grades_history table to see if the student previously had any grades in that course (i.e. was previously enrolled in the course)?

Do those grades ever get deleted from the _history table after the student has been unenrolled from the course for a certain period? Example, does cron ever "cleanup" that _history table?