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

Skip regrading of categories and calculated items that do not depend on $updated_item

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a course with a few activities and at least 1 students
      2. Setup the course gradebook to include categories and sub categories with items, calculated manual items and calculated categories. The idea is to test that all grade items that are supposed to be updated are being updated as in this issue we are reducing the amount of categories and calculated items that are being regraded
        1. Grade activities through the gradebook, check that all grades of categories (and parents) that contain the graded item are being updated, same with the total course grade. An example good test would be to grade a grade item (activity or manual item) located in course -> cat 1 -> sub cat 1.1 -> grade item. This is good because there are multiple levels.
        2. Repeat the same but grading through the activity, check that the gradebook is updated after saving changes
        3. Grade a user category, (for example sub cat 1.1 in the example above) check that all parents of the category are updated
        4. Add a calculated item referencing a grade item, update that grade item and ensure that the calculated item grade is updated according to what you changed.
        5. Repeat the same point but now with a calculated grade category which includes the updated grade item in the formula
      3. Finally add a new grade item to the course, which should trigger a full course gradebook regrade
      4. Check that the new values are what they are supposed to be
      Show
      Create a course with a few activities and at least 1 students Setup the course gradebook to include categories and sub categories with items, calculated manual items and calculated categories. The idea is to test that all grade items that are supposed to be updated are being updated as in this issue we are reducing the amount of categories and calculated items that are being regraded Grade activities through the gradebook, check that all grades of categories (and parents) that contain the graded item are being updated, same with the total course grade. An example good test would be to grade a grade item (activity or manual item) located in course -> cat 1 -> sub cat 1.1 -> grade item . This is good because there are multiple levels. Repeat the same but grading through the activity, check that the gradebook is updated after saving changes Grade a user category, (for example sub cat 1.1 in the example above) check that all parents of the category are updated Add a calculated item referencing a grade item, update that grade item and ensure that the calculated item grade is updated according to what you changed. Repeat the same point but now with a calculated grade category which includes the updated grade item in the formula Finally add a new grade item to the course, which should trigger a full course gradebook regrade Check that the new values are what they are supposed to be
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-53279_master
    • Sprint:
      3.1 Sprint 5
    • Issue size:
      Medium

      Description

      grade_regrade_final_grades is used to regrade the whole course gradebook and to regrade the gradebook for a single user, if userid is specified we require $updated_item argument too.

      Even if $updated_item is specified, we are marking all categories and calculated items as needsupdate, I can't think of any reason to update categories and calculated items that do not depend on the updated item.

      We have a grade_item::depends_on function, but it is only looking for items that directly depend on them (means that grade items located in a category are not included in the course item grade_item::depends_on()) and we should consider all dependant items. Items are not updated until all their dependencies are final grades, we could check that too.

        Attachments

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                23/May/16