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

Updating grade_item idnumber doesn't update course_module idnumber

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create an assignment
      2. Go to the gradebook, categories and items
      3. Edit topic total calculation
      4. Add id number “assign1” to assignment
      5. Click “add ID numbers”
      6. Enter grade calculation formula: =[[assign1]]
      7. Save changes
      8. Edit assignment settings
      9. Make sure ID number “assign1” appears under common module settings
      10. Change description
      11. Save and return to topic
      12. Go back to gradebook, categories and items
      13. Edit topic total calculation
      14. Make sure ID number “assign1” appears in list
      15. Make sure calculation formula displays correctly

      (note this effects all modules, but the test cases cover the assign module)

      Show
      Create an assignment Go to the gradebook, categories and items Edit topic total calculation Add id number “assign1” to assignment Click “add ID numbers” Enter grade calculation formula: =[ [assign1] ] Save changes Edit assignment settings Make sure ID number “assign1” appears under common module settings Change description Save and return to topic Go back to gradebook, categories and items Edit topic total calculation Make sure ID number “assign1” appears in list Make sure calculation formula displays correctly (note this effects all modules, but the test cases cover the assign module)
    • Workaround:
      Hide

      Set the module idnumber via the module settings form rather than via the gradebook. This will push the idnumber to the grade item.

      Show
      Set the module idnumber via the module settings form rather than via the gradebook. This will push the idnumber to the grade item.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-39740_grade_item_idnumber_fix

      Description

      If a module's grade item idnumber is set (via the Grades / ▶ Edit / ▶ Edit calculation page), and the associated course module does not yet have an idnumber set, it is supposed to push the new idnumber value to the course module's idnumber setting. This is failing due to a bug in grade_item::add_idnumber().

      As a result, when editing a module's settigs and saving, it will blow away the idnumber set on the grade item which effects the custom calculation set.

      This appears to be due to a check which is doing a strict type comparison, expecting an integer, but records back from the DB contain the value as a string.

      Steps to reproduce:

      1. Create an assignment
      2. Go to the gradebook, categories and items, full view
      3. Edit topic total calculation (click the calculator icon)
      4. Add id number “assign1” to assignment
      5. Click “add ID numbers”
      6. Enter grade calculation formula: =[[assign1]]
      7. Save changes
      8. Edit assignment settings
      9. Change description
      10. Save and return to topic
      11. Go back to gradebook, categories and items
      12. Edit topic total calculation
      13. Assignment ID number has disappeared from list
      14. Calculation formula now displays incorrectly, eg =##giXXX##

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ashleyholman Ashley Holman
              Reporter:
              ashleyholman Ashley Holman
              Peer reviewer:
              Damyon Wiese Damyon Wiese
              Integrator:
              Dan Poltawski Dan Poltawski
              Tester:
              Adrian Greeve Adrian Greeve
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/May/14