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

mod_assign: recalculation when deleting a user/group override does not work properly

XMLWordPrintable

    • MOODLE_500_STABLE
    • MOODLE_500_STABLE
    • MDL-85135-main
    • Hide

      Setup grade penalties

      Under Site administation:

      • Navigate to Grades > Grade penalties > Manage penalty plugins (/grade/penalty/manage_penalty_plugins.php).
        • Enable the Late submission penalties plugin.
      • Navigate to Grades > Grade penalties > Manage supported activities (/admin/settings.php?section=supportedplugins).
        • Select Assignment and save changes.
      • Navigate to Grades > Grade penalties > Late submission penalties > Penalty rules (/grade/penalty/duedate/manage_penalty_rule.php?contextid=1)
        • Create some penalty rules.

      Penalty with user/group override

      1. Create a test course
      2. Create an assignment in the course:
        1. Set due date to "Tomorrow" (a date in the future)
        2. Submission types: online text
        3. Make sure the grade type is set to point
        4. Enable "Grade penalties" under "Grade" section
      3. Create and enrol a student in the course
      4. Create a teacher in the course
      5. Log in as the student,
        1. Go to the assignment
        2. Add a submission.
      6. Log in as a teacher.
        1. Create a user or group override for that user with a due date in the past
        2. Mark the submission of the student
      7. In the assignment "Submissions" page, verify:
        • The penalty is applied to the grade in the final grade (gradebook grade) column.
      8. Delete the override created in step 6.1, make sure the "penalty recalculation" checkbox is selected
      9. In the assignment "Submissions" page, verify that the grade penalty is no longer applied to the grade in the final grade (gradebook grade) column. 
      Show
      Setup grade penalties Under Site administation: Navigate to Grades > Grade penalties > Manage penalty plugins (/grade/penalty/manage_penalty_plugins.php). Enable the Late submission penalties plugin. Navigate to Grades > Grade penalties > Manage supported activities (/admin/settings.php?section=supportedplugins). Select Assignment and save changes. Navigate to Grades > Grade penalties > Late submission penalties > Penalty rules (/grade/penalty/duedate/manage_penalty_rule.php?contextid=1) Create some penalty rules. Penalty with user/group override Create a test course Create an assignment in the course: Set due date to " Tomorrow " (a date in the future) Submission types: online text Make sure the grade type is set to point Enable "Grade penalties" under "Grade" section Create and enrol a student in the course Create a teacher in the course Log in as the student, Go to the assignment Add a submission. Log in as a teacher. Create a user or group override for that user with a due date in the past Mark the submission of the student In the assignment "Submissions" page, verify : The penalty is applied to the grade in the final grade (gradebook grade) column. Delete the override created in step 6.1, make sure the "penalty recalculation" checkbox is selected In the assignment "Submissions" page, verify that the grade penalty is no longer applied to the grade in the final grade (gradebook grade) column. 
    • Hide

      Code verified against automated checks.

      Checked MDL-85135 using repository: https://github.com/catalyst/moodle

      More information about this report

      Built on: Tue Apr 8 05:16:23 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-85135 using repository: https://github.com/catalyst/moodle main (0 errors / 0 warnings) [branch: MDL-85135_main | CI Job ] More information about this report Built on: Tue Apr 8 05:16:23 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-85135 -main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18965/ PHPUnit (sqlsrv / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64903/ Behat (NonJS - boost and classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64904/ Behat (Firefox - boost / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64905/ Behat (Firefox - classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/64906/ App tests (stable app version) / complete) Built on: Thu Apr 10 01:20:26 UTC 2025

      Problem

      When deleting an assign due date override with the recalculate grade penalties option enabled, the penalty recalculation happens just before the override is removed, instead of immediately after.

      Solution

      The re-calculation should happen after the override is deleted:

      https://github.com/moodle/moodle/blob/main/mod/assign/overridedelete.php#L70-L86

        1. (1) 7 Passed -- (Main)MDL-85135.png
          107 kB
          Kim Jared Lucas
        2. (1) 9 Passed -- (Main)MDL-85135.png
          90 kB
          Kim Jared Lucas

            Nguyen Nathan Nguyen
            Nguyen Nathan Nguyen
            Alexander Van der Bellen Alexander Van der Bellen
            Mihail Geshoski Mihail Geshoski
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m

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