Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -738,48 +738,8 @@ h3 {
|
|
| 738 |
""", unsafe_allow_html=True)
|
| 739 |
|
| 740 |
# ========== توابع اصلی ==========
|
| 741 |
-
def add_js_for_hidden_likert_buttons():
|
| 742 |
-
st.markdown("""
|
| 743 |
-
<script>
|
| 744 |
-
function hideLikertButtons() {
|
| 745 |
-
// مخفی کردن دکمههای لیکرت
|
| 746 |
-
var likertButtons = document.querySelectorAll('.likert-button');
|
| 747 |
-
likertButtons.forEach(function(button) {
|
| 748 |
-
button.style.display = 'none';
|
| 749 |
-
});
|
| 750 |
-
}
|
| 751 |
-
</script>
|
| 752 |
-
""", unsafe_allow_html=True)
|
| 753 |
-
|
| 754 |
-
st.markdown("""
|
| 755 |
-
<style>
|
| 756 |
-
/* مخفی کردن دکمههای لیکرت با استفاده از کلاسهای خاص */
|
| 757 |
-
.likert-button {
|
| 758 |
-
display: none !important;
|
| 759 |
-
}
|
| 760 |
-
</style>
|
| 761 |
-
""", unsafe_allow_html=True)
|
| 762 |
-
|
| 763 |
-
# اجرا کردن تابع جاوا اسکریپت برای مخفی کردن دکمهها
|
| 764 |
-
st.components.v1.html("""
|
| 765 |
-
<script>
|
| 766 |
-
// اجرا کردن تابع مخفی کردن دکمهها
|
| 767 |
-
window.onload = hideLikertButtons;
|
| 768 |
-
</script>
|
| 769 |
-
""", height=0)
|
| 770 |
-
|
| 771 |
-
def add_js_for_hidden_button():
|
| 772 |
-
st.markdown("""
|
| 773 |
-
<script>
|
| 774 |
-
function handleClick() {
|
| 775 |
-
// فعال کردن دکمه مخفی Streamlit
|
| 776 |
-
parent.document.querySelector('div[data-testid="stButton"] > button[kind="primary"]').click();
|
| 777 |
-
}
|
| 778 |
-
</script>
|
| 779 |
-
""", unsafe_allow_html=True)
|
| 780 |
-
|
| 781 |
def enhanced_likert_scale(question_data):
|
| 782 |
-
|
| 783 |
question = question_data["question"]
|
| 784 |
key = question_data["key"]
|
| 785 |
scale = question_data["scale"]
|
|
@@ -1221,7 +1181,6 @@ def map_view():
|
|
| 1221 |
st.rerun()
|
| 1222 |
|
| 1223 |
def attention_check1():
|
| 1224 |
-
add_js_for_hidden_button()
|
| 1225 |
"""سوال توجه اول با دکمه سبز کاملاً عملی"""
|
| 1226 |
# 1. تزریق استایلهای سفارشی
|
| 1227 |
st.markdown("""
|
|
@@ -1283,8 +1242,6 @@ def attention_check1():
|
|
| 1283 |
st.warning("لطفاً یک گزینه را انتخاب کنید")
|
| 1284 |
|
| 1285 |
def random_likert_questions():
|
| 1286 |
-
add_js_for_hidden_button()
|
| 1287 |
-
add_js_for_hidden_likert_buttons()
|
| 1288 |
"""نمایش سوالات لیکرت با دکمههای دایرهای"""
|
| 1289 |
question_groups = [
|
| 1290 |
{
|
|
|
|
| 738 |
""", unsafe_allow_html=True)
|
| 739 |
|
| 740 |
# ========== توابع اصلی ==========
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 741 |
def enhanced_likert_scale(question_data):
|
| 742 |
+
"""لیکرت اسکیل با خط و نقاط - کاملاً واکنشگرا"""
|
| 743 |
question = question_data["question"]
|
| 744 |
key = question_data["key"]
|
| 745 |
scale = question_data["scale"]
|
|
|
|
| 1181 |
st.rerun()
|
| 1182 |
|
| 1183 |
def attention_check1():
|
|
|
|
| 1184 |
"""سوال توجه اول با دکمه سبز کاملاً عملی"""
|
| 1185 |
# 1. تزریق استایلهای سفارشی
|
| 1186 |
st.markdown("""
|
|
|
|
| 1242 |
st.warning("لطفاً یک گزینه را انتخاب کنید")
|
| 1243 |
|
| 1244 |
def random_likert_questions():
|
|
|
|
|
|
|
| 1245 |
"""نمایش سوالات لیکرت با دکمههای دایرهای"""
|
| 1246 |
question_groups = [
|
| 1247 |
{
|