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

Commit

Permalink
popravek za dvojne ocene na celoletnem ocenjevanju
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Dec 15, 2023
1 parent 0adbc90 commit 5ce2868
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__pycache__/
test.py
20 changes: 12 additions & 8 deletions gimsisapi/formtagparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def get_grades(text):
grades = g.find("span").find("span").find_all("span")
if len(grades) > 1:
grade_nonprimary = []
grade_primary = None
grade_primary = []
for grade in grades:
stalna = "ocVmesna" not in grade["class"]
title = grade["title"].strip().splitlines()
Expand All @@ -332,16 +332,20 @@ def get_grades(text):
if not stalna:
grade_nonprimary.append(current_grade)
continue
grade_primary = current_grade
grade_primary.append(current_grade)
total_perm += int(g)
total_perm_count += 1
total += int(g)
if grade_primary is not None:
grade_primary.popravljane_ocene = grade_nonprimary
subject_grades[oc_obdobje]["grades"].append(grade_primary)
else:
for grade_non in grade_nonprimary:
subject_grades[oc_obdobje]["grades"].append(grade_non)

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

for grade_non in grade_nonprimary:
subject_grades[oc_obdobje]["grades"].append(grade_non)

continue

if len(grades) == 0:
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async def main():
#print(absences)
# gradings = await gimsis.fetch_gradings()
# print(gradings)
grades = await gimsis.fetch_grades(year="2023")
grades = await gimsis.fetch_grades(year="2022")
print(grades)
#profile = await gimsis.my_profile()
#print(profile)
Expand Down

0 comments on commit 5ce2868

Please sign in to comment.