Subtracting points for late submissions
Use AutoTest submission metadata to automatically and flexibly subtract points for late submissions.
One of the most common applications of AutoTest submission metadata is to automatically subtract points for late days. By default, students can not hand in after the deadline, to allow students to do that, turn it on by following the steps in:
In our example, we want to automatically subtract 1 point from the total rubric score for each day after the deadline, up to a maximum of 10 points subtracted:
  1. 1.
    Set up a rubric category with 11 items ranging from -10 to 0 or a continuous rubric category with a negative lower bound of -10.
  2. 2.
    Create a new AutoTest category linked to the new rubric category, and check the "Submission information" checkbox under "Advanced options".
  3. 3.
    Add a "Capture points" step with an appropriate name and the following settings:
    • Program to test: python3.7 $FIXTURES/deadline.py (Note the use of python3.7 instead of python3)
    • Regex to match: \f
  4. 4.
    Upload the following script as a fixture with the name deadline.py:
    1
    import math
    2
    from cg_at_utils import CG_INFO
    3
    import datetime
    4
    โ€‹
    5
    ONE_DAY = datetime.timedelta(days=1)
    6
    deadline = CG_INFO.deadline
    7
    submitted_at = CG_INFO.submitted_at
    8
    days_late = math.ceil((submitted_at - deadline) / ONE_DAY)
    9
    โ€‹
    10
    if days_late <= 0:
    11
    print('submitted on time :)')
    12
    print(1.0)
    13
    elif days_late <= 10:
    14
    print('{} days late'.format(days_late))
    15
    print(1 - days_late / 10)
    16
    else:
    17
    print('very late, maximum penalty')
    18
    print(0.0)
    Copied!
In this example, we are subtracting 1 rubric point per late day. Keep in mind that rubric points are not final grade points, unless your rubric has exactly 10 rubric points.

Learn more about submission metadata:

Last modified 4mo ago
Copy link