Spaces:
Sleeping
Sleeping
Delete api_utils.py
Browse files- api_utils.py +0 -12
api_utils.py
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
import requests
|
2 |
-
|
3 |
-
def fetch_questions(api_url: str) -> list:
|
4 |
-
response = requests.get(api_url)
|
5 |
-
response.raise_for_status()
|
6 |
-
return response.json()
|
7 |
-
|
8 |
-
def submit_answers(api_url: str, username: str, answers: list) -> dict:
|
9 |
-
payload = {"username": username, "submission": answers}
|
10 |
-
response = requests.post(api_url, json=payload)
|
11 |
-
response.raise_for_status()
|
12 |
-
return response.json()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|