Skip to content

Commit

Permalink
Merge pull request #99 from arielfayol37/polishing
Browse files Browse the repository at this point in the history
fixed bug in potential calculation:replaced assignment.due_date with …
  • Loading branch information
arielfayol37 authored Nov 21, 2023
2 parents ab6aac7 + 4991713 commit 981dd78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deimos/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ def get_potential(self, no_unit = False):
If no_unit, then we don't add the units points in the potential
"""
try:
days_overdue = max(0, (date.today() - self.question.assignment.due_date.date()).days)
assignment_student = AssignmentStudent.objects.get(assignment=self.question.assignment, student=self.student)
days_overdue = max(0, (date.today() - assignment_student.due_date.date()).days)
overall_percentage = max(self.question.assignment.grading_scheme.floor_percentage, \
1 - days_overdue * self.question.assignment.grading_scheme.late_sub_deduct)
except:
Expand Down

0 comments on commit 981dd78

Please sign in to comment.