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

Bulk updating grades for larger courses in single view causes database timeout

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 2.8
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide

      Summary:

      • A progress bar will now display if updating grades takes too long.
      • A confirmation page indicating any warnings and always which grades were saved will show when saving.
      • The user page in Single view now bulk updates without having to select override for each grade.

      Setup:

      • A course with enough activities and users to require pagination in Grades -> Single view. (So a Test course of size M or L)

      Test One:

      • Go to Single view in the Gradebook. Select a User.
      • Select bulk insert, choose a value and empty grades.
      • Save.
        • If it's a large course and is taking sometime, a progress bar will appear.
      • Any empty grades would have been saved with the new value. This should be reflected in a notification after saving.
        • If > that 1 page, check that the grades on the other pages have been updated too.

      Test Two:

      • Repeat above but by using the bulk insert option of ALL GRADES.

      Test Three:

      • Repeat above selecting a Grade item.

      Test Four:

      • Save individual grades and update feedback to ensure the notification indicates the right amount of grades were saved.

      Behat tags="gradereport_singleview" handy to run this too.

      Show
      Summary: A progress bar will now display if updating grades takes too long. A confirmation page indicating any warnings and always which grades were saved will show when saving. The user page in Single view now bulk updates without having to select override for each grade. Setup: A course with enough activities and users to require pagination in Grades -> Single view. (So a Test course of size M or L) Test One: Go to Single view in the Gradebook. Select a User. Select bulk insert, choose a value and empty grades. Save. If it's a large course and is taking sometime, a progress bar will appear. Any empty grades would have been saved with the new value. This should be reflected in a notification after saving. If > that 1 page, check that the grades on the other pages have been updated too. Test Two: Repeat above but by using the bulk insert option of ALL GRADES. Test Three: Repeat above selecting a Grade item. Test Four: Save individual grades and update feedback to ensure the notification indicates the right amount of grades were saved. Behat tags="gradereport_singleview" handy to run this too.
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Epic Link:
    • Pull from Repository:
    • Pull Master Branch:
      MDL-47893-master

      Description

      As the title suggests, bulk updating grades for larger courses (M sized courses or bigger) causes database timeouts due to thousands of grades trying to be updated in one go.

      Reproduction steps

      1. Create an M-sized or bigger course
      2. Go to the single view for that page and select a grade item
      3. Select override all
      4. Bulk insert a new grade for empty grades and hit submit
      5. Observe that you will either get an error or a blank page. Try reloading the grader report or single view. Note that neither of these pages will load.

      Expected results
      You should be able to bulk update just one page of a paginated single view.

      Actual results
      Single view tries to override all grades of all the paginated pages and causes timeouts as a result of this.

      What looks like is happening here is that since the single view is paginated, selecting 'override all' should only be overriding the grades on the current page. However, it seems that the pagination is ignored and all grades for the item are trying to be overridden at once. This causes timeout issues.

      This should be reworked so that only the current page of grades is overridden.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14