Spaces:
Sleeping
Sleeping
Remove NO_SUBMIT flag
Browse files
app.py
CHANGED
|
@@ -12,7 +12,6 @@ DEFAULT_API_URL = os.getenv(
|
|
| 12 |
"API_URL", "https://agents-course-unit4-scoring.hf.space")
|
| 13 |
QUESTIONS_URL = f"{DEFAULT_API_URL}/questions"
|
| 14 |
SUBMIT_URL = f"{DEFAULT_API_URL}/submit"
|
| 15 |
-
NO_SUBMIT = False
|
| 16 |
PLACEHOLDER_UNATTEMPTED = "_NOT_ATTEMPTED_"
|
| 17 |
|
| 18 |
# --- Agent Instantiation Helper ---
|
|
@@ -77,8 +76,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 77 |
|
| 78 |
submission_data = {"username": username.strip(
|
| 79 |
), "agent_code": agent_code, "answers": answers_payload}
|
| 80 |
-
|
| 81 |
-
return f"Submission SKIPPED (NO_SUBMIT=True). {len(answers_payload)} answers prepared.", results_df
|
| 82 |
print(f"Submitting {len(answers_payload)} answers to: {SUBMIT_URL}")
|
| 83 |
print("Submitting data:", json.dumps(submission_data, indent=2))
|
| 84 |
try:
|
|
@@ -234,8 +232,6 @@ def submit_current_results_action(profile: gr.OAuthProfile | None, results_log_l
|
|
| 234 |
|
| 235 |
submission_data = {"username": username.strip(
|
| 236 |
), "agent_code": agent_code, "answers": answers_payload}
|
| 237 |
-
if NO_SUBMIT:
|
| 238 |
-
return f"Submission SKIPPED. {len(answers_payload)} answers ready."
|
| 239 |
|
| 240 |
gr.Info(f"Submitting {len(answers_payload)} answers for '{username}'...")
|
| 241 |
print("Submitting data:", json.dumps(submission_data, indent=2))
|
|
|
|
| 12 |
"API_URL", "https://agents-course-unit4-scoring.hf.space")
|
| 13 |
QUESTIONS_URL = f"{DEFAULT_API_URL}/questions"
|
| 14 |
SUBMIT_URL = f"{DEFAULT_API_URL}/submit"
|
|
|
|
| 15 |
PLACEHOLDER_UNATTEMPTED = "_NOT_ATTEMPTED_"
|
| 16 |
|
| 17 |
# --- Agent Instantiation Helper ---
|
|
|
|
| 76 |
|
| 77 |
submission_data = {"username": username.strip(
|
| 78 |
), "agent_code": agent_code, "answers": answers_payload}
|
| 79 |
+
|
|
|
|
| 80 |
print(f"Submitting {len(answers_payload)} answers to: {SUBMIT_URL}")
|
| 81 |
print("Submitting data:", json.dumps(submission_data, indent=2))
|
| 82 |
try:
|
|
|
|
| 232 |
|
| 233 |
submission_data = {"username": username.strip(
|
| 234 |
), "agent_code": agent_code, "answers": answers_payload}
|
|
|
|
|
|
|
| 235 |
|
| 236 |
gr.Info(f"Submitting {len(answers_payload)} answers for '{username}'...")
|
| 237 |
print("Submitting data:", json.dumps(submission_data, indent=2))
|