2020-12-02 15:38:03 +01:00
|
|
|
import json
|
|
|
|
import requests
|
2021-02-05 20:22:24 +01:00
|
|
|
from .generate_cookies import autogenerate_cookies
|
2020-12-02 15:38:03 +01:00
|
|
|
|
2021-02-05 20:12:07 +01:00
|
|
|
def get_grades(register_id, students, oun, s):
|
2021-02-05 20:22:24 +01:00
|
|
|
cookies = autogenerate_cookies(students, s)
|
2021-01-09 20:58:49 +01:00
|
|
|
|
2021-02-05 20:22:24 +01:00
|
|
|
with open('app/API/headers.json') as f:
|
|
|
|
headers = json.load(f)
|
2021-01-09 20:58:49 +01:00
|
|
|
|
|
|
|
grades = requests.post(oun+'/Oceny.mvc/Get', headers=headers, cookies=cookies, json={'okres': register_id})
|
2020-12-21 13:38:24 +01:00
|
|
|
|
2021-01-09 20:58:49 +01:00
|
|
|
return grades.json()
|