Skip to content

[Bug] Text grades are unsupported #71

Description

@TobaT3

Describe the bug
When requesting grades, if the grade is not one of the three types in the code (eg. is not 1-5, points or percentages but for example text), max_points and possibly something else will be undefined.

Your code

allgrades = edupage.get_grades()

Error message

Traceback (most recent call last):
  File "/home/toba/Code/edupage-api-test/main.py", line 28, in <module>
    getGrades()
  File "/home/toba/Code/edupage-api-test/main.py", line 23, in getGrades
    allgrades = edupage.get_grades()
                ^^^^^^^^^^^^^^^^^^^^
  File "/home/toba/.local/lib/python3.11/site-packages/edupage_api/__init__.py", line 158, in get_grades
    return Grades(self).get_grades(year=None, term=None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/toba/.local/lib/python3.11/site-packages/edupage_api/module.py", line 95, in __impl
    return method(self, *method_args, **method_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/toba/.local/lib/python3.11/site-packages/edupage_api/grades.py", line 148, in get_grades
    subject_name, teacher, max_points, importance, verbal, percent)
                           ^^^^^^^^^^
UnboundLocalError: cannot access local variable 'max_points' where it is not associated with a value

Expected behavior
A clear and concise description of what you expected to happen.

Version

  • Edupage API version: 0.10.5
  • Python version: 3.11.5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions