Gradebook

Grades missing - restore from history?

 
 
Picture of Mathias Tausen
Grades missing - restore from history?
 

Hi everyone.

When looking at the report (complete or outline) of a users activity in a course, the grades themselves do not show - as seen in the below screenshot, the grades are replaced with a "-":

When examining the specific assignment, though, its clear that the user did receive a grade (bestået=passed):

The error applies only to a few specific users - and examining the MySQL tables of the Moodle installation reveals that the "mdl_grade_grades_history"-table contains a series of entries for that user, rather than the "mdl_grade_grades"-table. 
This leads me to the conclusion that the user may have been unenrolled from the course at one time, and has then been re-enrolled, thus "archiving" that users grades.

Is there any way to restore those grades? Is there any way to make those archived grades appear in the gradebook?
While I do realize I could export the entries manually and convert & insert them into the mdl_grade_grades table, that just seems like a bad solution, and would be a lot of (hopefully unnecessary) work.

Any help would be much appreciated.
Thanks!
-Mathias. 

Picture of Greg Rodenhiser
Re: Grades missing - restore from history?
 

Ever hear back on this?  Any help or answers you recieved would be huge.  Thanks!!

Picture of Bob Puffer
Re: Grades missing - restore from history?
Group Particularly helpful MoodlersGroup Testers

Didn't see your version listed but I read fast and may have skipped it.  If you're at 2.2 or greater the setting, "Recover grades default ($CFG->recovergradesdefault)" should take care of this for you.

Picture of Kimber Warden
Re: Grades missing - restore from history?
 

I deleted some students using the enrollment method Upload Users. Now, I can't restore their grades, whether I re-enroll them via Upload Users (putting a 0 in the delete column) or manually, using the "recover grades if possible" checkbox. Where is this setting you're referring to? Is there something else I should do to restore the grades?

Picture of Rok Lenardic
Re: Grades missing - restore from history?
 

Unfortunately, this seems to only be available starting version 2.3. Any similar solution in 2.2.1?

Picture of Mack Hucks
Re: Grades missing - restore from history?
 
Bob, Can you please explain your answer? I need to be able to recover grades for our flat file update. TIA
Picture of Bob Puffer
Re: Grades missing - restore from history?
Group Particularly helpful MoodlersGroup Testers

My answer had to do with a setting in Site administration->Grades->General settings that enables grades to be restored by default if a unenrolled student is re-enrolled.  If you don't have that setting ticked (its off by default, like THAT makes a lotta sense), then you have to fashion a query statement that will update mdl_grade_grades from mdl_grade_grades_history, making sure you bring the latest iteration of a student/grade item pair over.