mirror of
https://github.com/JonasunderscoreJones/epr_grader.git
synced 2025-10-28 09:39:18 +01:00
Information about the possible deduction in the stylecheck
This commit is contained in:
parent
fd58b6e19e
commit
9c98a81dc1
1 changed files with 9 additions and 10 deletions
|
|
@ -101,11 +101,15 @@ class ViolationChecker:
|
||||||
if i == 0: continue
|
if i == 0: continue
|
||||||
violation_string += f'-----{violation_group}-----\n{violation_groups_strings[i]}'
|
violation_string += f'-----{violation_group}-----\n{violation_groups_strings[i]}'
|
||||||
violation_amount = self.count_violations(i)
|
violation_amount = self.count_violations(i)
|
||||||
violation_string += (f'\nFehler Insgesamt: {violation_amount} Abzug: '
|
total_violations = f'\nFehler Insgesamt: {violation_amount}'
|
||||||
f'{self.count_deduction(i, violation_amount)} Punkte\n\n')
|
possible_deduction = f'Möglicher Abzug: {self.count_deduction(i, 100)}'
|
||||||
|
deduction = f'Abzug: {self.count_deduction(i, violation_amount)} Punkte\n\n'
|
||||||
|
violation_string += f'{total_violations} {possible_deduction} {deduction}'
|
||||||
if i == 9:
|
if i == 9:
|
||||||
violation_string += f'-----No deduction-----\n{violation_groups_strings[0]}'
|
total_violations = f'\nFehler Insgesamt: {violation_amount}'
|
||||||
violation_string += f'\nFehler Insgesamt: {violation_amount} Abzug: 0 Punkte'
|
possible_deduction = f'Möglicher Abzug: 0'
|
||||||
|
deduction = 'Abzug: 0 Punkte'
|
||||||
|
violation_string += f'{total_violations} {possible_deduction} {deduction}'
|
||||||
return violation_string
|
return violation_string
|
||||||
|
|
||||||
def count_violations(self, violation_group: int):
|
def count_violations(self, violation_group: int):
|
||||||
|
|
@ -138,12 +142,7 @@ class ViolationChecker:
|
||||||
# Violation for docstrings with a max deduction
|
# Violation for docstrings with a max deduction
|
||||||
return min(violation_amount*0.5, 2)
|
return min(violation_amount*0.5, 2)
|
||||||
else:
|
else:
|
||||||
# Cause group 6 is bigger it can get a higher deduction than 0.5
|
if violation_amount > 9:
|
||||||
if violation_group == 6 and violation_amount > 30:
|
|
||||||
return 1
|
|
||||||
elif violation_group == 6 and violation_amount > 20:
|
|
||||||
return 0.75
|
|
||||||
elif violation_amount > 9:
|
|
||||||
return 0.5
|
return 0.5
|
||||||
elif violation_amount > 1:
|
elif violation_amount > 1:
|
||||||
return 0.25
|
return 0.25
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue