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

Removing a grade override on an assignment (2.3) grade creates a mdl_grade_grades row for all users in mdl_user for that grade item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.3.3
    • 2.3.1
    • Assignment, Gradebook
    • None
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • Hide
      • Create a new course
      • Enrol 1 user in the course
      • Create an assignment in the course
      • View the course gradebook
      • Edit the grade for the user in the assignment - (do not make any changes - leave "overridden" off but save the form).
      • Run this SQL

        select count(*) from mdl_grade_grades where itemid in (select MAX(id) from mdl_grade_items);

      • The answer should be 1
      Show
      Create a new course Enrol 1 user in the course Create an assignment in the course View the course gradebook Edit the grade for the user in the assignment - (do not make any changes - leave "overridden" off but save the form). Run this SQL select count(*) from mdl_grade_grades where itemid in (select MAX(id) from mdl_grade_items); The answer should be 1

      Removing grade override on an assignment (2.3) grade creates a row in mdl_grade_grades for all users in mdl_user table for that grade item. This is causing performance problems on sites with a large number of users. For sites with a large number of users this will cause the script to run out of memory and never completely finish.

      To reproduce:
      1. Run this query to see how many mdl_grade_grades the guest user has:
      SELECT COUNT FROM mdl_grade_grades WHERE userid = 1 LIMIT 1;
      2. Create a course.
      3. Add an assignment (2.3 not older 2.2)
      4. Add 1 user as a student to course, but not guest user.
      5. Turn on editing in gradebook and type a grade in the assignment and update.
      6. Edit the grade and uncheck the "Overridden" check box and save changes. For sites with a large number of users this will cause the script to run out of memory.
      7. Run this query to see how many mdl_grade_grades the guest user has:
      SELECT COUNT FROM mdl_grade_grades WHERE userid = 1 LIMIT 1;
      You will see that count has increased.

      Running
      SELECT userid, COUNT FROM mdl_grade_grades WHERE itemid IN (SELECT itemid FROM mdl_grade_grades WHERE userid = 1) GROUP BY userid ORDER BY userid LIMIT 30;
      will help convince you that it is creating rows for all users for that itemid.

            damyon Damyon Wiese
            mspall Michael Spall
            Dan Poltawski Dan Poltawski
            Rajesh Taneja Rajesh Taneja
            Votes:
            11 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.