HELP! Students dropped from gradebook

HELP! Students dropped from gradebook

by Greg Rodenhiser -
Number of replies: 8

We current use flatfile enrollment for the enrollment of all our students/faculty in all our courses.  Last night a bad feed was generated and ran dropping all students from their courses.  We've reenrolled them, however the gradebooks now don't have any grades for these students.  If a student is dropped from a course, what happens to their grade data?  Is there a way to get it back?

Average of ratings: -
In reply to Greg Rodenhiser

Re: HELP! Students dropped from gradebook

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Unless the course is reset, it should retain the data, I seem to recall. Try the database, have a look at the gradebook tables, from memory it is the grades_grades table that contains the data you are looking for... If it is there then you should be able to restore it by matching old ids to new ids. (I recall this working in v1.9, but I cannot guarantee it in v2.x)

In reply to Colin Fraser

Re: HELP! Students dropped from gradebook

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

In V2.3 Site Administration > Grades > General Settings  you can select Recover Grades Default.


HTH

AL

In reply to AL Rachels

Re: HELP! Students dropped from gradebook

by Alan Kmiecik -

 Administration > Grades > General Settings  you can select Recover Grades Default

 

Does not work when re-enrolling using flat file.  Only works with manual re-enrolment

In reply to Colin Fraser

Re: HELP! Students dropped from gradebook

by Greg Rodenhiser -

We're currently in Moodle 2.2.2+...  I know in Moodle 1.9 if a student was dropped from a course their grade book items would return upon being put back in the course, however it appears that in Moodle 2.2.2+ once a student is dropped from a course but put back in their grades from the gradebook are gone.  We do have a sqldump (from MySQL) from the morning this happened.  Anyone know:

 

1.) am I correct in that in Moodle 2.2.x if a student is dropped from a course their grades will be gone and not come back should the return to the course?

 

2.) is there an easy way to get their grades back

 

3.) worst case would using the mysqldump from before all the drops allow us to get grades back?  Would restoring the missing entries in mdl_grade_grades from the older dump into the new database restore all these missing grades?

Anyone have advice on how best to procede? 

 

In reply to Greg Rodenhiser

Re: HELP! Students dropped from gradebook

by Mack Hucks -
Hi Greg, It sounds like a similar issue I have been looking into. Our system that feeds moodle may drop students for a variety of reasons then re-enroll later. I have created a work around by adding the code to recover grades to the flat file enrol plugin. Line 243 of moodle/enrol/flatfile/lib.php contains the following: $this->enrol_user($instance, $user->id, $roleid, $timestart, $timeend); I added the following directly after: $logline .= 'recovering grades:'; grade_recover_history_grades($userid, $courseid); I plan on creating a custom version so future upgrades do not "fix" the change.
In reply to Mack Hucks

Re: HELP! Students dropped from gradebook

by Alan Kmiecik -

Mack, 

I made the edit you suggested and got an error:  

!!! Coding error detected, it must be fixed by a programmer: PHP catchable fatal error !!!


Not sure if the period is suppose to be in front of the equal sign, either way, same error.

In reply to Mack Hucks

Re: HELP! Students dropped from gradebook

by Scott Krajewski -

I've been tackling this issue with database enrollment and commented at https://tracker.moodle.org/browse/MDL-36024 too.

@Mack @Alan

try this (untested). I think it should work.

after the global definitions (line 207 or so) add

require_once($CFG->libdir.'/gradelib.php');

then instead try (note the different variables used in this function)

$logline .= 'recovering grades:';
grade_recover_history_grades($user->id, $course->id);