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

Grades computed incorrectly if assignment name appears more than twice in a course

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.6.2
    • Fix Version/s: 1.6.3, 1.7
    • Component/s: Gradebook
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_16_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE

      Description

      Because the total possible points of an assignment are computed by adding up the point totals of assignments by their name, the gradebook attempts to add an index number to assignment names that are duplicated. However, it fails to increment this index number, resulting in an incorrect total possible points for each category if an assignment repeats a name more than twice. This might happen, for example, if a teacher has an assignment named "Participation" each week.

      To fix, replace line 182 of grade/lib.php as follows:
      $instance->name= $instance->name.' #'.++$i;// GVA fixed problem where there is more than one duplicate named assignment in any category in a given course. Old code: $instance->name= $instance->name.' '.$i.'';

      Note that I also change the naming of the duplicate assignment a little from before to make what is happeng more obvious when one looks at the assignment listing in the gradebook. Hence the second instance of an assignment named Participation would be called Participation #2, the third Participation #3, etc.

      This affects past and present versions of Moodle including 1.7dev. As it would be a non-obvious incorrect computation of a student's grade, I have marked this bug as critical.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Oct/06