Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1260,11 +1260,25 @@ def explanation_questions():
|
|
| 1260 |
)
|
| 1261 |
|
| 1262 |
if st.button("ادامه", key=f"continue_{current_step}"):
|
| 1263 |
-
|
|
|
|
| 1264 |
st.warning("لطفاً یک گزینه را انتخاب کنید")
|
| 1265 |
else:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1266 |
st.session_state.explanation_step += 1
|
| 1267 |
st.rerun()
|
|
|
|
| 1268 |
else:
|
| 1269 |
# مرحله آخر: ذخیره دادهها و رفتن به فرم دموگرافیک
|
| 1270 |
st.session_state.trust = st.session_state.get("trust_radio")
|
|
|
|
| 1260 |
)
|
| 1261 |
|
| 1262 |
if st.button("ادامه", key=f"continue_{current_step}"):
|
| 1263 |
+
response = st.session_state.get(q["key"])
|
| 1264 |
+
if response is None:
|
| 1265 |
st.warning("لطفاً یک گزینه را انتخاب کنید")
|
| 1266 |
else:
|
| 1267 |
+
# 🟣 ذخیره پاسخ فعلی در session_state
|
| 1268 |
+
key_mapping = {
|
| 1269 |
+
"trust_radio": "trust",
|
| 1270 |
+
"pricing_method_radio": "pricing_method",
|
| 1271 |
+
"price_increase_radio": "price_increase",
|
| 1272 |
+
"explanation_received_radio": "explanation_received",
|
| 1273 |
+
"explanation_type_radio": "explanation_type"
|
| 1274 |
+
}
|
| 1275 |
+
logical_key = key_mapping.get(q["key"])
|
| 1276 |
+
if logical_key:
|
| 1277 |
+
st.session_state[logical_key] = response
|
| 1278 |
+
|
| 1279 |
st.session_state.explanation_step += 1
|
| 1280 |
st.rerun()
|
| 1281 |
+
|
| 1282 |
else:
|
| 1283 |
# مرحله آخر: ذخیره دادهها و رفتن به فرم دموگرافیک
|
| 1284 |
st.session_state.trust = st.session_state.get("trust_radio")
|