Maryam Ilka commited on
Commit
030e154
·
verified ·
1 Parent(s): c3b19a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -12
app.py CHANGED
@@ -234,15 +234,14 @@ st.markdown("""
234
  }
235
 
236
  /* دکمه سبز (ثالث) */
237
- .stGreenButton>button,
238
- [data-testid="baseButton-third"],
239
- .green-btn {
240
- background-color: #28a745 !important; /* رنگ سبز */
241
  color: white !important;
242
  border: none !important;
243
  border-radius: 8px !important;
244
  padding: 10px 20px !important;
245
  font-weight: bold !important;
 
246
  }
247
 
248
 
@@ -610,14 +609,23 @@ def attention_check1():
610
  index=None,
611
  key="att1_radio"
612
  )
613
-
614
- if st.green_button("ادامه"):
615
- if answer:
616
- st.session_state.attention_check1 = answer # ذخیره پاسخ در session_state
617
- st.session_state.current_page = "random_likert_questions"
618
- st.rerun()
619
- else:
620
- st.warning("لطفاً یک گزینه را انتخاب کنید")
 
 
 
 
 
 
 
 
 
621
 
622
  def attention_check2():
623
  """سوال توجه دوم (بدون بررسی پاسخ صحیح)"""
 
234
  }
235
 
236
  /* دکمه سبز (ثالث) */
237
+ div[data-testid="stButton"] > button.green-btn {
238
+ background-color: #28a745 !important;
 
 
239
  color: white !important;
240
  border: none !important;
241
  border-radius: 8px !important;
242
  padding: 10px 20px !important;
243
  font-weight: bold !important;
244
+ width: 100% !important;
245
  }
246
 
247
 
 
609
  index=None,
610
  key="att1_radio"
611
  )
612
+
613
+ # سپس دکمه را ایجاد کنید
614
+ col1, col2 = st.columns([1, 2])
615
+ with col2:
616
+ btn = st.button("ادامه", key="continue_green")
617
+ if btn:
618
+ st.markdown("""
619
+ <script>
620
+ document.querySelector('[data-testid="stButton"] button').classList.add('green-btn');
621
+ </script>
622
+ """, unsafe_allow_html=True)
623
+ if answer:
624
+ st.session_state.attention_check1 = answer # ذخیره پاسخ در session_state
625
+ st.session_state.current_page = "random_likert_questions"
626
+ st.rerun()
627
+ else:
628
+ st.warning("لطفاً یک گزینه را انتخاب کنید")
629
 
630
  def attention_check2():
631
  """سوال توجه دوم (بدون بررسی پاسخ صحیح)"""