Update app.py
Browse files
app.py
CHANGED
|
@@ -139,8 +139,10 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
| 139 |
|
| 140 |
|
| 141 |
def save_fn(profile: gr.OAuthProfile | None):
|
| 142 |
-
|
|
|
|
| 143 |
json.dump([], f, indent=2)
|
|
|
|
| 144 |
|
| 145 |
# --- Build Gradio Interface using Blocks ---
|
| 146 |
with gr.Blocks() as demo:
|
|
@@ -176,7 +178,8 @@ with gr.Blocks() as demo:
|
|
| 176 |
)
|
| 177 |
|
| 178 |
save_button.click(
|
| 179 |
-
fn=save_fn
|
|
|
|
| 180 |
)
|
| 181 |
|
| 182 |
|
|
|
|
| 139 |
|
| 140 |
|
| 141 |
def save_fn(profile: gr.OAuthProfile | None):
|
| 142 |
+
filename = "saved_answers.json"
|
| 143 |
+
with open(filename, "w") as f:
|
| 144 |
json.dump([], f, indent=2)
|
| 145 |
+
return f"✅ Saved to {filename}", filename
|
| 146 |
|
| 147 |
# --- Build Gradio Interface using Blocks ---
|
| 148 |
with gr.Blocks() as demo:
|
|
|
|
| 178 |
)
|
| 179 |
|
| 180 |
save_button.click(
|
| 181 |
+
fn=save_fn,
|
| 182 |
+
outputs=[status_output, results_table]
|
| 183 |
)
|
| 184 |
|
| 185 |
|