Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1267,27 +1267,18 @@ def random_likert_questions():
|
|
| 1267 |
button_label = "ادامه به گروه بعدی" if st.session_state.current_likert_group < len(question_groups)-1 else "اتمام پرسشنامه"
|
| 1268 |
|
| 1269 |
if st.button(button_label):
|
| 1270 |
-
#
|
| 1271 |
-
|
| 1272 |
-
question["key"] in st.session_state
|
| 1273 |
-
|
| 1274 |
-
for question in current_group['questions']
|
| 1275 |
-
)
|
| 1276 |
-
|
| 1277 |
-
has_zero = any(
|
| 1278 |
-
st.session_state.answers.get(question["key"]) == 0
|
| 1279 |
-
for question in current_group['questions']
|
| 1280 |
-
)
|
| 1281 |
|
| 1282 |
-
|
| 1283 |
-
|
|
|
|
|
|
|
| 1284 |
else:
|
| 1285 |
-
|
| 1286 |
-
|
| 1287 |
-
st.rerun()
|
| 1288 |
-
else:
|
| 1289 |
-
st.session_state.current_page = "explanation_questions"
|
| 1290 |
-
st.rerun()
|
| 1291 |
|
| 1292 |
def explanation_questions():
|
| 1293 |
"""نمایش سوالات تکمیلی به صورت مرحلهای با دکمه ادامه"""
|
|
|
|
| 1267 |
button_label = "ادامه به گروه بعدی" if st.session_state.current_likert_group < len(question_groups)-1 else "اتمام پرسشنامه"
|
| 1268 |
|
| 1269 |
if st.button(button_label):
|
| 1270 |
+
# ذخیره پاسخها قبل از رفتن به گروه بعدی
|
| 1271 |
+
for question in current_group['questions']:
|
| 1272 |
+
if question["key"] in st.session_state:
|
| 1273 |
+
st.session_state.answers[question["key"]] = st.session_state[question["key"]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1274 |
|
| 1275 |
+
# رفتن به گروه بعدی یا صفحه پایانی
|
| 1276 |
+
if st.session_state.current_likert_group < len(question_groups) - 1:
|
| 1277 |
+
st.session_state.current_likert_group += 1
|
| 1278 |
+
st.rerun()
|
| 1279 |
else:
|
| 1280 |
+
st.session_state.current_page = "explanation_questions"
|
| 1281 |
+
st.rerun()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1282 |
|
| 1283 |
def explanation_questions():
|
| 1284 |
"""نمایش سوالات تکمیلی به صورت مرحلهای با دکمه ادامه"""
|