_This is edited from the forum post: https://moodle.org/mod/forum/discuss.php?d=245963#p1361950_
In Moodle 2.5 [but also the current version (3)], when you are logged in as a student and add an assignment, the table mdl_grade_grades gets a 'timecreated' time stamp.
Go back into the assignment as a teacher and grade the submission: go check the grade_grades table and find that the 'timecreated' time stamp gets changed to NULL.
Here are some files and things to check:
- mod/assign/locallib.php - gradebook_item_update() calls convert_grade_for_gradebook() where datesubmitted is set to null. Lastly it calls mod/assign/lib.php - calls assign_grade_item_update(), passing the data structure where datesubmitted is null
- mod/assign/lib.php - assign_grade_Item_update() calls lib/gradelib.php - grade_update() passing the data structure where datesubmitted is null
- lib/gradelib.php - grade_update() calls lib/grade/grade_item.php - update_raw_grade() passing datesubmitted as an argument
- lib/grade/grade_item.php - update_raw_grade() sets the grade_grades instance timecreated property to datesubmitted (null). The docblock stating "$datesubmitted A timestamp of when the student's work was submitted", but it's value is set to null.
I am wanting this fixed so that 'timecreated' stays there, and doesn't get set to NULL on assignments in the grade_grades table. If anyone knows why this was done in the first place, I would be very interested to know.