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

itemnumber automatic generation in grade_item might collide with itemnumber 0 used by modules.

    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
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The problem here is that the grading code in modules uses grade item with itemnumber==0 for storage of grades. It is hardcoded in calls to grade_update(). It guarantees that it gets updates the same grade_item each time. It will also significantly simplify the migration of original gradebook data because the conversion of grade items is done during the main upgrade phase, the grades_items will be updated and actual grades send to new gradebook in the module upgrade.php script.

      The problem could appear if we first manually create grade_item for assignment that does not yet have associated grade_item with itemnumber==0 (means assignment not graded). But then teacher enables grading.

      I am not sure how to solve it, either we could define some ranges of itemnumbers 0..1000 for automatically created grade_items, 1001...2000 for imports and manual grading. And do the autoincrementing only in the manual/import range only.
      Or we could always require the itemnumber and remove the autogeneration completely.

        Attachments

          Activity

            People

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

              Dates

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