FD900 commited on
Commit
5932c3c
·
verified ·
1 Parent(s): 5afbe61

Create submit.py

Browse files
Files changed (1) hide show
  1. submit.py +15 -0
submit.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+
3
+ GAIA_API = "https://gaia-course-api.spacelab.dev"
4
+
5
+ def submit_answers(username: str, code_link: str, answers: list):
6
+ payload = {
7
+ "username": username,
8
+ "space": code_link,
9
+ "answers": answers,
10
+ }
11
+ response = requests.post(f"{GAIA_API}/submit", json=payload)
12
+ if response.status_code == 200:
13
+ return "✅ Submission successful!"
14
+ else:
15
+ return f"❌ Submission failed: {response.status_code} - {response.text}"