Sina Media Lab commited on
Commit
0d7d5a4
·
1 Parent(s): f5a14cf
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -195,6 +195,12 @@ if submit_button:
195
 
196
  # Show correct/incorrect feedback and explanation
197
  st.session_state.button_label = "Next"
 
 
 
 
 
 
198
 
199
  # Show correct/incorrect feedback after submission
200
  if current_question.get('answered', False):
@@ -211,10 +217,3 @@ if current_question.get('answered', False):
211
  st.write("**Step-by-Step Solution:**")
212
  for step in current_question['step_by_step_solution']:
213
  st.write(step)
214
-
215
- # Handle switching to the next question on button click
216
- if submit_button and st.session_state.button_label == "Next":
217
- new_question = generate_new_question(selected_module, modules[selected_module])
218
- st.session_state.questions.append(new_question)
219
- st.session_state.current_index = len(st.session_state.questions) - 1
220
- st.session_state.button_label = "Submit"
 
195
 
196
  # Show correct/incorrect feedback and explanation
197
  st.session_state.button_label = "Next"
198
+ else:
199
+ # Generate a new question and reset the button label
200
+ new_question = generate_new_question(selected_module, modules[selected_module])
201
+ st.session_state.questions.append(new_question)
202
+ st.session_state.current_index = len(st.session_state.questions) - 1
203
+ st.session_state.button_label = "Submit"
204
 
205
  # Show correct/incorrect feedback after submission
206
  if current_question.get('answered', False):
 
217
  st.write("**Step-by-Step Solution:**")
218
  for step in current_question['step_by_step_solution']:
219
  st.write(step)