emvecchi commited on
Commit
339fdf8
·
verified ·
1 Parent(s): 801adb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -689,7 +689,7 @@ def prep_and_save_data(index, skip_sample, completed: bool):
689
  base = st.session_state.data.iloc[index][COLS_TO_SAVE].to_dict()
690
 
691
  payload = {
692
- **existing, # previously saved stuff (extra keys, old schema, etc.)
693
  **base,
694
  'user_id': st.session_state.user_id,
695
  'index': st.session_state.current_index,
@@ -840,15 +840,15 @@ elif st.session_state.current_index < len(st.session_state.data):
840
  show_fields(STEPS[step])
841
 
842
  c1, c2, c3 = st.columns([1,5,2])
843
- # with c1:
844
- # if st.button("<< Previous"):
845
- # if step > 0:
846
- # st.session_state.step -= 1
847
- # st.rerun()
848
- # else:
849
- # st.session_state.current_index -= 1
850
- # st.session_state.step = total_steps - 1
851
- # st.rerun()
852
  with c2:
853
  label = " **Submit >>**" if step < total_steps - 1 else "**Submit & next session**"
854
  if st.button(label):
 
689
  base = st.session_state.data.iloc[index][COLS_TO_SAVE].to_dict()
690
 
691
  payload = {
692
+ **existing,
693
  **base,
694
  'user_id': st.session_state.user_id,
695
  'index': st.session_state.current_index,
 
840
  show_fields(STEPS[step])
841
 
842
  c1, c2, c3 = st.columns([1,5,2])
843
+ with c1:
844
+ if st.button("<< Previous"):
845
+ if step > 0:
846
+ st.session_state.step -= 1
847
+ st.rerun()
848
+ else:
849
+ st.session_state.current_index -= 1
850
+ st.session_state.step = total_steps - 1
851
+ st.rerun()
852
  with c2:
853
  label = " **Submit >>**" if step < total_steps - 1 else "**Submit & next session**"
854
  if st.button(label):