GSMEthesis commited on
Commit
40ff07b
·
verified ·
1 Parent(s): 61ee2b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -11
app.py CHANGED
@@ -832,6 +832,7 @@ def enhanced_likert_scale(question_data):
832
  box-shadow: none !important;
833
  outline: none !important;
834
  background: transparent !important;
 
835
  }}
836
  </style>
837
  """,
@@ -844,19 +845,21 @@ def enhanced_likert_scale(question_data):
844
  # نمایش لیبل‌ها و دکمه‌ها تو یه ردیف
845
  st.markdown('<div class="likert-labels">', unsafe_allow_html=True)
846
  st.markdown(f'<span style="text-align:right">{labels[0]}</span>', unsafe_allow_html=True)
847
- st.markdown('<div class="likert-buttons">', unsafe_allow_html=True)
848
 
849
- # دکمه‌ها تو یه ردیف با flex
 
 
850
  for i in range(scale):
851
- value = scale - i # 7 تا 1
852
- symbol = "•" if st.session_state[key] == value else "○"
853
- if st.button(
854
- symbol,
855
- key=f"streamlit-btn-{key}-{value}",
856
- help=str(value)
857
- ):
858
- st.session_state[key] = value
859
- st.rerun()
 
860
 
861
  st.markdown('</div>', unsafe_allow_html=True)
862
  st.markdown(f'<span style="text-align:left">{labels[1]}</span>', unsafe_allow_html=True)
 
832
  box-shadow: none !important;
833
  outline: none !important;
834
  background: transparent !important;
835
+ border-radius: 50% !important;
836
  }}
837
  </style>
838
  """,
 
845
  # نمایش لیبل‌ها و دکمه‌ها تو یه ردیف
846
  st.markdown('<div class="likert-labels">', unsafe_allow_html=True)
847
  st.markdown(f'<span style="text-align:right">{labels[0]}</span>', unsafe_allow_html=True)
 
848
 
849
+ # دکمه‌ها تو یه ردیف با st.columns
850
+ st.markdown('<div class="likert-buttons">', unsafe_allow_html=True)
851
+ cols = st.columns(scale)
852
  for i in range(scale):
853
+ with cols[i]:
854
+ value = scale - i # 7 تا 1
855
+ symbol = "•" if st.session_state[key] == value else "○"
856
+ if st.button(
857
+ symbol,
858
+ key=f"streamlit-btn-{key}-{value}",
859
+ help=str(value)
860
+ ):
861
+ st.session_state[key] = value
862
+ st.rerun()
863
 
864
  st.markdown('</div>', unsafe_allow_html=True)
865
  st.markdown(f'<span style="text-align:left">{labels[1]}</span>', unsafe_allow_html=True)