helene-rousset commited on
Commit
d4549d6
·
verified ·
1 Parent(s): 3acdcf3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- with open("saved_answers.json", "w") as f:
 
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