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

update_grade doesn't always update the 'finalgrade' field when it should

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: Gradebook
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Hi – I have a custom assignment type that allows me to autograde student work (among other things), and so far it's been working very well, except OCCASIONALLY the grade_update function will fail to update the finalgrade column in the database.

      Here's my call to grade_update:

      grade_update( 'mod/assignment', $this->assignment->courseid, 'mod', 'assignment', $this->assignment->id, 0, $newgrade );

      with $newgrade being an array containing the following fields:

      userid
      feedback
      feedbackformat
      usermodified
      datesubmitted
      dategraded
      rawgrade

      What happens, in rare cases, is that the "rawgrade" entry in the database will be set to some value (e.g., 100), but the "finalgrade" entry in the database will not be updated, so the students have whatever was there before (students can turn in their work, auto-grade it, see the results immediately, resubmit, auto-grade, and repeat until they get all the points).

      Naturally this makes students panic (I'm running a class with 500 students!) when the feedback says "You got 100" and the official grade in the gradebook says "90".

      When I check the entry in the database, sure enough "rawgrade" is set to 100, but "finalgrade" is still set to 90.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              skodak Petr Skoda
              Reporter:
              humper Greg Humphreys
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                3/Mar/08