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

auto_update_weights calls update() even if there is no aggregationcoef2 change

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Behat and phpunit should all pass you can do some further testing:

      1. On a course with a few students, activities and grade categories using natural aggregation
      2. Grade some students, select one of these students and make it the super man, with all its grades to 100%. This will help later when checking if the weights are updated accordingly
      3. Go to grader report and open 'gradebook setup' in another tab
      4. In gradebook setup tab, move activites around different categories, each time you move an item, check that the weights are updated according to your changes and the totals too
      5. Try also moving grade categories inside other grade categories
      6. Weights should change according to your changes
      Show
      Behat and phpunit should all pass you can do some further testing: On a course with a few students, activities and grade categories using natural aggregation Grade some students, select one of these students and make it the super man, with all its grades to 100%. This will help later when checking if the weights are updated accordingly Go to grader report and open 'gradebook setup' in another tab In gradebook setup tab, move activites around different categories, each time you move an item, check that the weights are updated according to your changes and the totals too Try also moving grade categories inside other grade categories Weights should change according to your changes
    • Affected Branches:
      MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-53301_master
    • Sprint:
      3.1 Sprint 5
    • Issue size:
      Medium

      Description

      As most of the gradebook performance reports are related with full gradebook regrades, I've created a test course (tool_generator - M size) with around 1000 users and 100 activities to see the basic configuration issues. I've been changing the gradebook structure and checking which interactions with the database we have to see if there is anything we could improve.

      New grade category and manual grade items results in around 1000-1500 db reads and 400-700 db writes, I see many stuff and I don't want to mess up with the whole gradebook design nor implement major changes here, but auto_update_weights seems to be calling update() unnecessarily. I've reduced the number of db writes to half of it with the provided patch. I haven't seen any gradeitem modifications to justify an update() call if the aggregatecoef2 value is not changed. As a beneficial side effect this reduces the number of records added to grade history which is also the reason why we have that many insert record calls.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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