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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 1.6.3, 1.7
    • 1.6.2
    • Gradebook
    • None
    • All
    • MOODLE_16_STABLE
    • MOODLE_16_STABLE, MOODLE_17_STABLE

      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.

            skodak Petr Skoda
            ganderson Gary Anderson
            Stephen Bourget Stephen Bourget
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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