Sina Media Lab
commited on
Commit
·
9905637
1
Parent(s):
0d7d5a4
Updates
Browse files
app.py
CHANGED
@@ -180,10 +180,8 @@ with st.form(key=f'question_form_{st.session_state.current_index}'):
|
|
180 |
|
181 |
# Handle button state and answer submission
|
182 |
if submit_button:
|
183 |
-
if
|
184 |
-
|
185 |
-
else:
|
186 |
-
if st.session_state.button_label == "Submit":
|
187 |
# Process the answer
|
188 |
current_question['selected'] = selected_answer
|
189 |
current_question['answered'] = True
|
@@ -195,12 +193,12 @@ if submit_button:
|
|
195 |
|
196 |
# Show correct/incorrect feedback and explanation
|
197 |
st.session_state.button_label = "Next"
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
|
205 |
# Show correct/incorrect feedback after submission
|
206 |
if current_question.get('answered', False):
|
|
|
180 |
|
181 |
# Handle button state and answer submission
|
182 |
if submit_button:
|
183 |
+
if st.session_state.button_label == "Submit":
|
184 |
+
if selected_answer is not None:
|
|
|
|
|
185 |
# Process the answer
|
186 |
current_question['selected'] = selected_answer
|
187 |
current_question['answered'] = True
|
|
|
193 |
|
194 |
# Show correct/incorrect feedback and explanation
|
195 |
st.session_state.button_label = "Next"
|
196 |
+
|
197 |
+
elif st.session_state.button_label == "Next":
|
198 |
+
new_question = generate_new_question(selected_module, modules[selected_module])
|
199 |
+
st.session_state.questions.append(new_question)
|
200 |
+
st.session_state.current_index = len(st.session_state.questions) - 1
|
201 |
+
st.session_state.button_label = "Submit"
|
202 |
|
203 |
# Show correct/incorrect feedback after submission
|
204 |
if current_question.get('answered', False):
|