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

Implement generic penalties in Gradebook

XMLWordPrintable

    • MOODLE_500_STABLE
    • MDL-80984-main
    • Hide

      Overview

      Features:

      1. New plugin type: "Grade penalty"
      2. A "Grade penalty" plugin: "Late submission penalty", which define rules to calculate penalty (based on submission date and due date )
      3. A new grade API function: apply_grade_penalty_to_user, which will be used by supported module to apply penalty over original grade
      4. Grade penalty implementation in assignment module
      5. Allow user to trigger penalty recalculation
      6. Show penalty indicator in user and grader report
      7. Option to apply penalty to overridden grade, providing the penalty was applied to original grade.

      Settings

      Enable "Late submission penalty" plugin

      1. Go to "Grades > Grade penalties > Manage penalty plugins* in site administration:
        • Click on 'toggle' button to enable 'Late submission penalties' plugin
      2. Go to "Grades > Grade penalties > Late submission penalties > Penalty rules":
        • Create some penalty rules

      Enable "Grade penalty" for assignment

      1. Go to "Grades > Grade penalties > Supported modules":
        • Click to select "Assignment"
        • Save changes

      Enable "Apply penalty to overridden grades"

      1. Go to "Grades > Grade penalties > Supported modules":
        • Enable "Apply penalty to overridden grades"
        • Save changes

      Testing: Penalty implementation on an assignment

      1. Create a test course
      2. Create an assignment in the course:
        1. Set due date to "Yesterday" / a date in the past
        2. Submission types: File submissions
        3. Make sure grade type is set to point
        4. Enable "Grade penalties" under "Grade" section
      3. Enrol a student to the course
      4. Login as the student
      5. Add an submission
      6. Log in as an teacher to mark the submission
        1. Expected behavior: The grade in grade book is deducted according to the penalty rules
        2. In the submission list: the grade is original assignment grade (without penalty), the final grade (gradebook grade) is the one with penalty

      Testing: Penalty recalculation

      1. Go to the assignment created on previous test
      2. Go to "Grade penalties" on Assignment navigation bar
      3. Change penalty rules
      4. Then click on "Recalculate penalties" button
      5. Wait or run cron job so that "recalculate_penalties" adhoc task can be run:
        1. Expected: the adhoc task "recalculate_penalties" should run
        2. The final grade of the student should be recalculated according to the new rules

      Testing: Penalty indicator

      1. Go to the test course
      2. Make sure the course is on "Non editing"
      3. Go to "Grade > Grader report". Expected:
        1. There is a red triangle icon, with a tooltip showing the penalty
      4. Go to "Grade > User report".
      5. Select the testing user. Expected:
        1. There is a red triangle icon, with a tooltip showing the penalty

      Testing: Apply penalty to overridden mark

      1. Go to the test course
      2. Go to "Grade > Grader report"
      3. Turn on "Editing mode"
      4. Change "Original grade" for the testing assignment grade item
      5. Make sure the "Exempt penalty" is not checked
      6. Save changes. Expected:
        1. The "Current grade" is subtracted with the same penalized amount
      7. Turn off "Editing mode". Expected:
        1. The grade is same as "Current grade" and showing penalty indicator
      8. Turn on "Editing mode" again
      9. Tick "Exempt penalty" checkbox
      10. Save changes. Expected:
        1. The "Current grade" is the same as "Original grade"
      11. Turn off "Editing mode". Expected:
        1. The grade is same as "Current grade" and there is no penalty indicator

      Testing: No penalty is applied to imported grade

      Testing the notification

      1. Enable a penalty plugin.
        • /grade/penalty/manage_penalty_plugins.php
      2. Navigate to a course.
      3. Navigate to Grades > Import.
      4. Verify the notification is displayed on the various import pages.
      5. Disable all penalty plugins.
      6. Verify the notification no longer appears.

        Testing Import

      • Create a course with an assignment.
      • Enrol some students and give them a grade.
      • Grade export will include the raw mark and final mark. The final mark includes any penalties.
      • Navigate to the course > Grades > Export.
      • Export the grades for the assignment.
        • Export as > Plain text file.
      • Delete the recent grades from the mdl_grade_grades table.
      • Verify the grades are gone (Grades > Grader report and/or assignment > Submissions).
      • Set the assignment due date to some point in the past and configure penalty rules if not already done.
      • Import the grades.
        • Map from > Email address.
        • Map to > Email address.
        • [assignment] (Real) > Grade items > [assignment]
      • Verify the grades have been restored, and no additional penalties have been applied.
      Show
      Overview Features: New plugin type: "Grade penalty" A "Grade penalty" plugin: "Late submission penalty", which define rules to calculate penalty (based on submission date and due date ) A new grade API function: apply_grade_penalty_to_user, which will be used by supported module to apply penalty over original grade Grade penalty implementation in assignment module Allow user to trigger penalty recalculation Show penalty indicator in user and grader report Option to apply penalty to overridden grade, providing the penalty was applied to original grade. Settings Enable "Late submission penalty" plugin Go to "Grades > Grade penalties > Manage penalty plugins* in site administration: Click on 'toggle' button to enable 'Late submission penalties' plugin Go to "Grades > Grade penalties > Late submission penalties > Penalty rules": Create some penalty rules Enable "Grade penalty" for assignment Go to "Grades > Grade penalties > Supported modules": Click to select "Assignment" Save changes Enable "Apply penalty to overridden grades" Go to "Grades > Grade penalties > Supported modules": Enable "Apply penalty to overridden grades" Save changes Testing: Penalty implementation on an assignment Create a test course Create an assignment in the course: Set due date to "Yesterday" / a date in the past Submission types: File submissions Make sure grade type is set to point Enable "Grade penalties" under "Grade" section Enrol a student to the course Login as the student Add an submission Log in as an teacher to mark the submission Expected behavior: The grade in grade book is deducted according to the penalty rules In the submission list: the grade is original assignment grade (without penalty), the final grade (gradebook grade) is the one with penalty Testing: Penalty recalculation Go to the assignment created on previous test Go to "Grade penalties" on Assignment navigation bar Change penalty rules Then click on "Recalculate penalties" button Wait or run cron job so that "recalculate_penalties" adhoc task can be run: Expected: the adhoc task "recalculate_penalties" should run The final grade of the student should be recalculated according to the new rules Testing: Penalty indicator Go to the test course Make sure the course is on "Non editing" Go to "Grade > Grader report". Expected: There is a red triangle icon, with a tooltip showing the penalty Go to "Grade > User report". Select the testing user. Expected: There is a red triangle icon, with a tooltip showing the penalty Testing: Apply penalty to overridden mark Go to the test course Go to "Grade > Grader report" Turn on "Editing mode" Change "Original grade" for the testing assignment grade item Make sure the "Exempt penalty" is not checked Save changes. Expected: The "Current grade" is subtracted with the same penalized amount Turn off "Editing mode". Expected: The grade is same as "Current grade" and showing penalty indicator Turn on "Editing mode" again Tick "Exempt penalty" checkbox Save changes. Expected: The "Current grade" is the same as "Original grade" Turn off "Editing mode". Expected: The grade is same as "Current grade" and there is no penalty indicator Testing: No penalty is applied to imported grade Testing the notification Enable a penalty plugin. /grade/penalty/manage_penalty_plugins.php Navigate to a course. Navigate to Grades > Import. Verify the notification is displayed on the various import pages. Disable all penalty plugins. Verify the notification no longer appears. Testing Import Create a course with an assignment. Enrol some students and give them a grade. Grade export will include the raw mark and final mark. The final mark includes any penalties. Navigate to the course > Grades > Export. Export the grades for the assignment. Export as > Plain text file. Delete the recent grades from the mdl_grade_grades table. Verify the grades are gone (Grades > Grader report and/or assignment > Submissions). Set the assignment due date to some point in the past and configure penalty rules if not already done. Import the grades. Map from > Email address. Map to > Email address. [assignment] (Real) > Grade items > [assignment] Verify the grades have been restored, and no additional penalties have been applied.
    • Show
      Fails against automated checks. Checked MDL-80984 using repository: https://github.com/catalyst/moodle main (3 errors / 0 warnings) [branch: MDL-80984-main | CI Job ] overview (0/0) , phplint (0/0) , phpcs (3/0) , js (0/0) , css (0/0) , phpdoc (0/0) , commit (0/0) , savepoint (0/0) , thirdparty (0/0) , externalbackup (0/0) , grunt (0/0) , shifter (0/0) , mustache (0/0) , gherkin (0/0) , Should these errors be fixed? Built on: Wed Mar 19 06:30:27 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-80984 -main https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/18662/ PHPUnit (sqlsrv / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63930/ Behat (NonJS - boost and classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63931/ Behat (Firefox - boost / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63932/ Behat (Firefox - classic / complete) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/63933/ App tests (stable app version) / complete) Built on: Wed Mar 19 07:07:05 UTC 2025

      There were few trackers regarding implementing penalties for late submission. Those requests are related to either quizzes or assignments as most  popular assessment tools in Moodle.

      It feels like there is a need for implementing generic penalties for graded activities (not just quizzes or assignments).

       
      Forum posts:

       

      Similar funcionality in Canvas - https://community.canvaslms.com/t5/Instructor-Guide/How-do-I-apply-a-Late-Submission-policy-in-the-Gradebook/ta-p/965

       

      A diagram of how penalty is applied to a late submission:

       

       

       

        1. (1) 6 Passed -- (Main)MDL-80984.png
          785 kB
          Kim Jared Lucas
        2. (2) 5 Passed -- (Main)MDL-80984.png
          779 kB
          Kim Jared Lucas
        3. (3) 3 Passed -- (Main)MDL-80984.png
          51 kB
          Kim Jared Lucas
        4. (3) 5 Passed -- (Main)MDL-80984.png
          62 kB
          Kim Jared Lucas
        5. (4) 10 Passed -- (Main)MDL-80984.png
          55 kB
          Kim Jared Lucas
        6. (4) 11 Passed -- (Main)MDL-80984.png
          49 kB
          Kim Jared Lucas
        7. (4) 6 Passed -- (Main)MDL-80984.png
          56 kB
          Kim Jared Lucas
        8. (4) 7 Passed -- (Main)MDL-80984.png
          57 kB
          Kim Jared Lucas
        9. (5) 4 Passed -- (Main)MDL-80984.png
          60 kB
          Kim Jared Lucas
        10. (5) 6 Passed -- (Main)MDL-80984.png
          54 kB
          Kim Jared Lucas
        11. (6) 1 Passed -- (Main)MDL-80984.png
          48 kB
          Kim Jared Lucas
        12. deductedmark_failure.png
          101 kB
          Sara Arjona (@sarjona)
        13. Grade_penalty_navigation.png
          27 kB
          Nathan Nguyen
        14. grader_report.png
          115 kB
          Nathan Nguyen
        15. marking page.png
          85 kB
          Nathan Nguyen
        16. Mockup_add_edit_rule.png
          17 kB
          Nathan Nguyen
        17. Mockup_course_configuration.png
          45 kB
          Nathan Nguyen
        18. Mockup_site_configuration.png
          77 kB
          Nathan Nguyen
        19. Penalty Core.jpeg
          71 kB
          Nathan Nguyen
        20. submission.png
          128 kB
          Nathan Nguyen
        21. user_report.png
          27 kB
          Nathan Nguyen

            Nguyen Nathan Nguyen
            dmitriim Dmitrii Metelkin
            Alexander Van der Bellen Alexander Van der Bellen
            Andrew Lyons Andrew Lyons
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            8 Vote for this issue
            Watchers:
            28 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 5 hours, 14 minutes
                3d 5h 14m

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