timecreated is null in mdl_grade_grades after grading submission

timecreated is null in mdl_grade_grades after grading submission

by Akinsaya Delamarre -
Number of replies: 2

In Moodle 2.5 I added an assignment, logged in as a student and added a submission.

I looked in mdl_grade_grades table and saw that the timecreated field had a time stamp.  I initially thought timecreated was for when a record was added to the table.

I went back into the assignment as a teacher and graded the submission, when I looked at mdl_grade_grades table I saw the timecreated field changed to null and the timemodifed field had a timestamp.

 I was looking through the code and noticed the following call stack:

- 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.

 

This seems like a bug but wanted to get some input on this to see if there was an undocumented reason.

 

I came across this because I had a teacher user giving an assignment grade for a student that never added a submission; thought the timecreated field in the mdl_grade_grades was null to denote the user never actually submitted anything.  Unfortunately this is always the case no matter the scenario.

 

In reply to Akinsaya Delamarre

Re: timecreated is null in mdl_grade_grades after grading submission

by Evan Donovan -

I noticed this in one of my courses in Moodle 2.6.4+ as well. I am not 100% sure this is why the timecreated field is NULL, but it seems probable. Is there any fix?

In reply to Akinsaya Delamarre

Re: timecreated is null in mdl_grade_grades after grading submission

by Rebecca Trynes -
I also noticed this, as I'm trying to add the datesubmitted to the grader report!
Verrrrryyyyyy annoying.

Any answers? I'd love to hear it!!
And get it fixed!!!!!