Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Text grades are unsupported #71

Open
TobaT3 opened this issue Nov 1, 2023 · 1 comment
Open

[Bug] Text grades are unsupported #71

TobaT3 opened this issue Nov 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@TobaT3
Copy link

TobaT3 commented Nov 1, 2023

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
@TobaT3 TobaT3 added the bug Something isn't working label Nov 1, 2023
@ivanhrabcak
Copy link
Collaborator

Could you try to put a breakpoint in the code and see what grade_type is the grade that is erroring out?

If you need help, I suggest we meetup in a call in my server.

@BelKed BelKed changed the title [Bug] [Bug] Text grades are unsupported Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants