Sina Media Lab
commited on
Commit
·
291d95e
1
Parent(s):
0446125
Updates
Browse files
app.py
CHANGED
@@ -187,7 +187,6 @@ if submit_button and st.session_state.button_label == "Submit":
|
|
187 |
|
188 |
# Show correct/incorrect feedback and explanation
|
189 |
st.session_state.button_label = "Next Question"
|
190 |
-
st.experimental_rerun()
|
191 |
|
192 |
# Show correct/incorrect feedback after submission
|
193 |
if current_question.get('answered', False):
|
@@ -207,3 +206,10 @@ if current_question.get('answered', False):
|
|
207 |
|
208 |
# Change the button label immediately after showing the solution
|
209 |
st.session_state.button_label = "Next Question"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
|
188 |
# Show correct/incorrect feedback and explanation
|
189 |
st.session_state.button_label = "Next Question"
|
|
|
190 |
|
191 |
# Show correct/incorrect feedback after submission
|
192 |
if current_question.get('answered', False):
|
|
|
206 |
|
207 |
# Change the button label immediately after showing the solution
|
208 |
st.session_state.button_label = "Next Question"
|
209 |
+
|
210 |
+
# This part handles switching to the next question on button click
|
211 |
+
if submit_button and st.session_state.button_label == "Next Question":
|
212 |
+
new_question = generate_new_question(selected_module, modules[selected_module])
|
213 |
+
st.session_state.questions.append(new_question)
|
214 |
+
st.session_state.current_index = len(st.session_state.questions) - 1
|
215 |
+
st.session_state.button_label = "Submit"
|