Sina Media Lab commited on
Commit
c7df340
·
1 Parent(s): d3582b2
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -194,6 +194,13 @@ if submit_button:
194
  st.session_state.questions[st.session_state.current_index]['answered'] = True
195
  st.session_state.selected_answer = selected_answer
196
 
 
 
 
 
 
 
 
197
  # Show correct/incorrect feedback after submission
198
  if current_question.get('answered', False):
199
  for option in current_question['options']:
@@ -209,7 +216,3 @@ if current_question.get('answered', False):
209
  st.write("**Step-by-Step Solution:**")
210
  for step in current_question['step_by_step_solution']:
211
  st.write(step)
212
-
213
- # If submit button was pressed and question was answered, update the UI to disable options
214
- if current_question.get('answered', False) and not disabled_options:
215
- st.experimental_rerun()
 
194
  st.session_state.questions[st.session_state.current_index]['answered'] = True
195
  st.session_state.selected_answer = selected_answer
196
 
197
+ else:
198
+ # If already answered, move to the next question
199
+ new_question = generate_new_question(selected_module, modules[selected_module])
200
+ st.session_state.questions.append(new_question)
201
+ st.session_state.current_index = len(st.session_state.questions) - 1
202
+ st.session_state.answered = False
203
+
204
  # Show correct/incorrect feedback after submission
205
  if current_question.get('answered', False):
206
  for option in current_question['options']:
 
216
  st.write("**Step-by-Step Solution:**")
217
  for step in current_question['step_by_step_solution']:
218
  st.write(step)