Sina Media Lab commited on
Commit
a743789
·
1 Parent(s): e6f6b59
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -178,17 +178,15 @@ selected_answer = st.radio(
178
  if selected_answer:
179
  st.session_state.submit_enabled = True
180
 
181
- # Submit/New actions as radio buttons
182
- if st.session_state.submit_enabled or st.session_state.new_enabled:
183
- action = st.radio(
184
- "Choose an action:",
185
- ("Submit", "New"),
186
- index=0 if st.session_state.submit_enabled else 1,
187
- key="action_radio",
188
- horizontal=True
189
- )
190
- else:
191
- action = None
192
 
193
  # Handle the selected action
194
  if action == "Submit" and st.session_state.submit_enabled:
 
178
  if selected_answer:
179
  st.session_state.submit_enabled = True
180
 
181
+ # Show Submit/New actions as disabled if no option is selected
182
+ action = st.radio(
183
+ "Choose an action:",
184
+ ("Submit", "New"),
185
+ index=None,
186
+ key="action_radio",
187
+ disabled=(not st.session_state.submit_enabled and not st.session_state.new_enabled),
188
+ horizontal=True
189
+ )
 
 
190
 
191
  # Handle the selected action
192
  if action == "Submit" and st.session_state.submit_enabled: