Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1466,7 +1466,6 @@ def random_likert_questions():
|
|
| 1466 |
|
| 1467 |
st.rerun()
|
| 1468 |
|
| 1469 |
-
|
| 1470 |
def explanation_questions():
|
| 1471 |
"""نمایش سوالات تکمیلی به صورت مرحلهای با دکمه ادامه"""
|
| 1472 |
st.markdown("### 📋 سؤالات تکمیلی")
|
|
@@ -1498,7 +1497,7 @@ def explanation_questions():
|
|
| 1498 |
},
|
| 1499 |
{
|
| 1500 |
"key": "explanation_received",
|
| 1501 |
-
"label": "
|
| 1502 |
"options": ["بله", "خیر"],
|
| 1503 |
"required": True
|
| 1504 |
},
|
|
@@ -1515,7 +1514,6 @@ def explanation_questions():
|
|
| 1515 |
}
|
| 1516 |
]
|
| 1517 |
|
| 1518 |
-
|
| 1519 |
# مقداردهی اولیه step اگر وجود ندارد
|
| 1520 |
if "explanation_step" not in st.session_state:
|
| 1521 |
st.session_state.explanation_step = 0
|
|
@@ -1544,6 +1542,29 @@ def explanation_questions():
|
|
| 1544 |
key=f"explanation_q_{current_q['key']}"
|
| 1545 |
)
|
| 1546 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1547 |
# دکمه ادامه
|
| 1548 |
if st.button("ادامه", key=f"continue_{current_q['key']}"):
|
| 1549 |
if answer is None and current_q["required"]:
|
|
@@ -1557,7 +1578,7 @@ def explanation_questions():
|
|
| 1557 |
|
| 1558 |
# رفرش صفحه برای نمایش سوال بعدی
|
| 1559 |
st.rerun()
|
| 1560 |
-
|
| 1561 |
def demographic_form():
|
| 1562 |
"""فرم اطلاعات دموگرافیک"""
|
| 1563 |
st.markdown("### 📝 اطلاعات دموگرافیک")
|
|
|
|
| 1466 |
|
| 1467 |
st.rerun()
|
| 1468 |
|
|
|
|
| 1469 |
def explanation_questions():
|
| 1470 |
"""نمایش سوالات تکمیلی به صورت مرحلهای با دکمه ادامه"""
|
| 1471 |
st.markdown("### 📋 سؤالات تکمیلی")
|
|
|
|
| 1497 |
},
|
| 1498 |
{
|
| 1499 |
"key": "explanation_received",
|
| 1500 |
+
"label": "در صفحهای که اطلاعات سفر را دریافت کردید، زیر بخش قیمت، آیا رهیار توضیحی در مورد علت قیمتگذاری به شما ارائه داد؟",
|
| 1501 |
"options": ["بله", "خیر"],
|
| 1502 |
"required": True
|
| 1503 |
},
|
|
|
|
| 1514 |
}
|
| 1515 |
]
|
| 1516 |
|
|
|
|
| 1517 |
# مقداردهی اولیه step اگر وجود ندارد
|
| 1518 |
if "explanation_step" not in st.session_state:
|
| 1519 |
st.session_state.explanation_step = 0
|
|
|
|
| 1542 |
key=f"explanation_q_{current_q['key']}"
|
| 1543 |
)
|
| 1544 |
|
| 1545 |
+
if current_q["key"] == "explanation_received":
|
| 1546 |
+
with st.expander("نمونه توضیحات قیمتگذاری", expanded=False):
|
| 1547 |
+
# ایجاد یک کانتینر برای وسط چین کردن
|
| 1548 |
+
col1, col2, col3 = st.columns([1, 6, 1])
|
| 1549 |
+
|
| 1550 |
+
with col2:
|
| 1551 |
+
try:
|
| 1552 |
+
st.image("control.png",
|
| 1553 |
+
width=400, # اندازه بزرگتر
|
| 1554 |
+
caption="نمونه بدون توضیح",
|
| 1555 |
+
use_container_width=True) # پارامتر جدید جایگزین
|
| 1556 |
+
|
| 1557 |
+
st.image("input.png",
|
| 1558 |
+
width=400,
|
| 1559 |
+
caption="نمونه توضیح",
|
| 1560 |
+
use_container_width=True)
|
| 1561 |
+
|
| 1562 |
+
st.image("counterfactual.png",
|
| 1563 |
+
width=400,
|
| 1564 |
+
caption="نمونه توضیح",
|
| 1565 |
+
use_container_width=True)
|
| 1566 |
+
except Exception as e:
|
| 1567 |
+
st.warning(f"تصاویر نمونه یافت نشدند. خطا: {str(e)}")
|
| 1568 |
# دکمه ادامه
|
| 1569 |
if st.button("ادامه", key=f"continue_{current_q['key']}"):
|
| 1570 |
if answer is None and current_q["required"]:
|
|
|
|
| 1578 |
|
| 1579 |
# رفرش صفحه برای نمایش سوال بعدی
|
| 1580 |
st.rerun()
|
| 1581 |
+
|
| 1582 |
def demographic_form():
|
| 1583 |
"""فرم اطلاعات دموگرافیک"""
|
| 1584 |
st.markdown("### 📝 اطلاعات دموگرافیک")
|