Fix point checking

This commit is contained in:
Matej Focko 2019-12-02 11:39:40 +01:00
parent 1bcdc0839f
commit 0cbb641426

View file

@ -87,13 +87,20 @@ class Parser:
def __filter(self, all_submissions: Dict[str, List[Submission]]) -> None:
for _, submissions in all_submissions.items():
length = len(submissions)
i = -1
while not submissions[i].submitted_before_deadline and i >= -length:
i -= 1
if not submissions[0].submitted_before_deadline:
continue
if i >= -length:
submissions[i].flag = "REVIEW"
length = len(submissions)
max_i = 0
for i in range(1, length):
if not submissions[i].submitted_before_deadline:
break
if submissions[i].points >= submissions[max_i].points:
max_i = i
submissions[max_i].flag = "REVIEW"
def __correct_errors(self, all_submissions: Dict[str, List[Submission]]) -> None:
response = input("Do you wish to fix errors? ").strip()