Spaces:
Paused

GSMEthesis commited on
Commit
c8189b2
·
verified ·
1 Parent(s): 16c84b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -804,11 +804,10 @@ def enhanced_likert_scale(question_data):
804
  </div>
805
  </div>
806
  """, unsafe_allow_html=True)
807
-
808
- # ایجاد دکمه‌ها با ترتیب معکوس (7 در سمت راست)
809
  btn_cols = st.columns(scale)
810
  for i in range(scale):
811
- with btn_cols[scale - 1 - i]: # محاسبه معکوس index
812
  value = scale - i # مقدار از 7 به 1
813
  if st.button(
814
  str(value),
@@ -818,8 +817,8 @@ def enhanced_likert_scale(question_data):
818
  st.session_state[key] = value
819
  st.rerun()
820
 
821
- # نمایش پاسخ انتخاب شده
822
- if st.session_state.get(key) is not None:
823
  st.markdown(
824
  f"<div style='text-align:center; color:#6a0dad; font-weight:bold; margin-top:10px;'>"
825
  f"پاسخ شما: {st.session_state[key]}"
 
804
  </div>
805
  </div>
806
  """, unsafe_allow_html=True)
807
+
 
808
  btn_cols = st.columns(scale)
809
  for i in range(scale):
810
+ with btn_cols[i]: # مهم: اینجا i تغییر نکرده
811
  value = scale - i # مقدار از 7 به 1
812
  if st.button(
813
  str(value),
 
817
  st.session_state[key] = value
818
  st.rerun()
819
 
820
+ # نمایش پاسخ (فقط اگر انتخاب شده باشد)
821
+ if st.session_state.get(key):
822
  st.markdown(
823
  f"<div style='text-align:center; color:#6a0dad; font-weight:bold; margin-top:10px;'>"
824
  f"پاسخ شما: {st.session_state[key]}"