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?
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 V2.3 Site Administration > Grades > General Settings you can select Recover Grades Default.
AL
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
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?
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.
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);