emvecchi commited on
Commit
4320d61
·
verified ·
1 Parent(s): 49ed3f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -939,18 +939,9 @@ elif st.session_state.current_index < len(st.session_state.data):
939
  show_fields(STEPS[step])
940
 
941
  # Action buttons
942
- c1, c2, c3 = st.columns([3,5,2])
943
  with c1:
944
- if st.button("Previous"):
945
- if step > 0:
946
- st.session_state.step -= 1
947
- st.rerun()
948
- else:
949
- st.session_state.current_index -= 1
950
- st.session_state.step = total_steps - 1
951
- st.rerun()
952
- with c2:
953
- label = "**Next**" if step < total_steps - 1 else "**Submit & next session**"
954
  if st.button(label):
955
  if validate_current_page(STEPS[step], st.session_state.current_index):
956
  is_last_page = (step == total_steps - 1)
@@ -965,7 +956,15 @@ elif st.session_state.current_index < len(st.session_state.data):
965
  else:
966
  st.session_state.step += 1
967
  st.rerun()
968
-
 
 
 
 
 
 
 
 
969
  elif st.session_state.current_index == len(st.session_state.data):
970
  st.write(f"**Thank you for taking part in this study!** \n ")
971
  # if st.button("Previous"):
 
939
  show_fields(STEPS[step])
940
 
941
  # Action buttons
942
+ c1, c2, c3 = st.columns([5,3,2])
943
  with c1:
944
+ label = "**:red[Submit]**" if step < total_steps - 1 else "**:red[Submit & next session]**"
 
 
 
 
 
 
 
 
 
945
  if st.button(label):
946
  if validate_current_page(STEPS[step], st.session_state.current_index):
947
  is_last_page = (step == total_steps - 1)
 
956
  else:
957
  st.session_state.step += 1
958
  st.rerun()
959
+ with c2:
960
+ if st.button("Previous"):
961
+ if step > 0:
962
+ st.session_state.step -= 1
963
+ st.rerun()
964
+ else:
965
+ st.session_state.current_index -= 1
966
+ st.session_state.step = total_steps - 1
967
+ st.rerun()
968
  elif st.session_state.current_index == len(st.session_state.data):
969
  st.write(f"**Thank you for taking part in this study!** \n ")
970
  # if st.button("Previous"):