Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-43449

timecreated and timemodified in mdl_grade_grades set to null after grading submission or removing grade

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.5.3, 3.1
    • Assignment, Gradebook
    • MOODLE_25_STABLE, MOODLE_31_STABLE
    • Hide

      Timecreated set to null when submission is graded

      • Create a test user
      • Create a course
      • Enrol the user into the course
      • Created an assignment
      • Login as the student and add a submission
      • Notice the grade_grades timecreated field is set
      • Login as an admin and give the student a grade
      • Notice the grade_grades timecreted field is set to null but the timemodified field is set.

      Timemodified set to null when grade is removed from assignment grading interface

      • Create a test user
      • Create a course
      • Enrol the user into the course
      • Created an assignment
      • Go into the assignment and give the student a grade
      • Notice the mdl_grade_grades timemodified values is set
      • Go back into the assignment and remove the grade from the grading textfield
      • Notice the mld_grade_grades timemodified value is set to null
      Show
      Timecreated set to null when submission is graded Create a test user Create a course Enrol the user into the course Created an assignment Login as the student and add a submission Notice the grade_grades timecreated field is set Login as an admin and give the student a grade Notice the grade_grades timecreted field is set to null but the timemodified field is set. Timemodified set to null when grade is removed from assignment grading interface Create a test user Create a course Enrol the user into the course Created an assignment Go into the assignment and give the student a grade Notice the mdl_grade_grades timemodified values is set Go back into the assignment and remove the grade from the grading textfield Notice the mld_grade_grades timemodified value is set to null

      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.


      Similar to timecreated, the timemodified field in mld_grade_grades gets set to null given the following steps:

      • Create a test user
      • Create a course
      • Enrol the user into the course
      • Created an assignment
      • Go into the assignment and give the student a grade
      • Notice the mdl_grade_grades timemodified values is set
      • Go back into the assignment and remove the grade from the grading textfield
      • Notice the mld_grade_grades timemodified value is set to null

            Unassigned Unassigned
            adelamarre Akin (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.