Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
če profesor ne klikne zaključi, se dogajajo čudne stvari
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Mar 21, 2024
1 parent 5d6c2ec commit de7f810
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions gimsisapi/formtagparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,28 @@ def get_grades(text):
except Exception as e:
print(f"[GIMSIS FAILURE] Failure while parsing one of the grades: {e} {text}")

# Profesorica ni kliknila na "Zaključi" pri dveh rokih,
# posledično sta obe oceni označeni kot nestalni, kar zmede
# sistem.
#
# Zato uporabimo najboljšo oceno kot popravljeno
if len(grade_primary) == 0 and len(grade_nonprimary) >= 2:
best_grade = grade_nonprimary[0]
for grade_non in grade_nonprimary:
if grade_non.ocena > best_grade.ocena:
best_grade = grade_non
grade_nonprimary.remove(best_grade)
best_grade.je_zakljucena = True
grade_primary.append(best_grade)

if len(grade_primary) > 0:
for grade in grade_primary:
grade.popravljane_ocene = grade_nonprimary
subject_grades[oc_obdobje]["grades"].append(grade)
continue

# Ne bi vedel, če se ta del sploh še požene.
# Bom pustil tukaj za vsak slučaj.
for grade_non in grade_nonprimary:
subject_grades[oc_obdobje]["grades"].append(grade_non)

Expand Down

0 comments on commit de7f810

Please sign in to comment.