# Advanced Conditional Points Example: Penalize Late Completion

With advanced conditional points, you can encourage students to submit their work early by adding an increasing penalty for later submissions before the due date.

Grant extensions to apply penalties after the due date.

You can use this example as shown or adjust the values as needed.

 Formula  my ($i,$p, @pbd) = (0, 0, ( [2, 'days', .05 ], [1, 'days', .10 ], [4, 'hours', .20 ] )); while ( &beforeDue($pbd[$i][1]) <= $pbd[$i][0] && $i <=$#pbd ) { $p =$pbd[$i][2];$i++; } decform($POINTS * (1 -$p),3)  Your answers are penalized if submitted close to the due date according to the following schedule:
• 2 days before the due date: 5%
• 1 day before the due date: 10%
• 4 hours before the due date: 20%


To add, update, or remove penalty values and periods, change the @pbd array values in lines 3-5. For example, [2, 'days', .05] deducts 5% for answers submitted less than 2 days before the due date.

List penalty periods in chronological order, starting with the earliest period.

Conditional points can't be calculated based on assignment availability dates, but instead are based on the due date.
Important Because granting an extension changes the student's due date, automatic bonus or penalty points based on the due date will be applied based on the student's extended due date. If needed, adjust the student's assignment score after the extension period ends.
• Formula must include a single <eqn> tag containing one or more Perl statements.
• The value of the last Perl statement is used as the point value for the question or question part.
• Formula is limited to 255 characters (including line breaks). Additional characters are not saved.