emvecchi commited on
Commit
16a911d
·
verified ·
1 Parent(s): e2e9007

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -20
app.py CHANGED
@@ -159,10 +159,10 @@ fields: List[Field] = [
159
  Field(name="other_comments", type="text", title="Please provide any additional details or information:", mandatory=False),
160
  ]),
161
  ]
162
- url_conditional_fields = [
163
- Field(name="skip", type="skip_checkbox",
164
- title="*I am uncomfortable annotating this text and voluntarily skip this instance*", mandatory=False)
165
- ]
166
  INPUT_FIELD_DEFAULT_VALUES = {'slider': 0,
167
  'text': '',
168
  'textarea': '',
@@ -751,18 +751,12 @@ if 'unacceptable_response' in st.session_state and st.session_state.unacceptable
751
  )
752
  st.stop()
753
 
754
- # batch-specific data subset
755
- #st.session_state.batch = get_param_from_url("batch")
756
 
757
  # Load the data to annotate
758
  if 'data' not in st.session_state:
759
  st.session_state.data = read_data()
760
 
761
  # user id
762
- #user_id_from_url = get_param_from_url("user_id")
763
- #if user_id_from_url:
764
- # st.session_state.user_id = user_id_from_url
765
- # If user_id is in URL → set it
766
  user_id_from_url = get_param_from_url("user_id")
767
  if user_id_from_url and not st.session_state.get("user_id"):
768
  st.session_state.user_id = user_id_from_url
@@ -815,10 +809,6 @@ elif st.session_state.current_index == -1:
815
  add_validated_submit([st.session_state.user_id], "Please enter a valid user ID")
816
 
817
  elif st.session_state.current_index < len(st.session_state.data):
818
- #add_annotation_guidelines()
819
- #with st.form("data_form"+str(st.session_state.current_index)):
820
- # show_fields(fields)
821
- #render_rupture_markers_widget(st.session_state.current_index, rupture_choices)
822
  show_fields(fields)
823
 
824
  # Action buttons
@@ -830,12 +820,6 @@ elif st.session_state.current_index < len(st.session_state.data):
830
  prep_and_save_data(st.session_state.current_index, ('skip' in st.session_state and st.session_state['skip']))
831
  st.success("Saved!")
832
  navigate(1)
833
- # with c2:
834
- # if st.button("Save only"):
835
- # if validate_current_page(fields, st.session_state.current_index):
836
- # with st.spinner("saving"):
837
- # prep_and_save_data(st.session_state.current_index, ('skip' in st.session_state and st.session_state['skip']))
838
- # st.success("Saved!")
839
 
840
  elif st.session_state.current_index == len(st.session_state.data):
841
  st.write(f"**Thank you for taking part in this study!** \n ")
 
159
  Field(name="other_comments", type="text", title="Please provide any additional details or information:", mandatory=False),
160
  ]),
161
  ]
162
+ #url_conditional_fields = [
163
+ # Field(name="skip", type="skip_checkbox",
164
+ # title="*I am uncomfortable annotating this text and voluntarily skip this instance*", mandatory=False)
165
+ #]
166
  INPUT_FIELD_DEFAULT_VALUES = {'slider': 0,
167
  'text': '',
168
  'textarea': '',
 
751
  )
752
  st.stop()
753
 
 
 
754
 
755
  # Load the data to annotate
756
  if 'data' not in st.session_state:
757
  st.session_state.data = read_data()
758
 
759
  # user id
 
 
 
 
760
  user_id_from_url = get_param_from_url("user_id")
761
  if user_id_from_url and not st.session_state.get("user_id"):
762
  st.session_state.user_id = user_id_from_url
 
809
  add_validated_submit([st.session_state.user_id], "Please enter a valid user ID")
810
 
811
  elif st.session_state.current_index < len(st.session_state.data):
 
 
 
 
812
  show_fields(fields)
813
 
814
  # Action buttons
 
820
  prep_and_save_data(st.session_state.current_index, ('skip' in st.session_state and st.session_state['skip']))
821
  st.success("Saved!")
822
  navigate(1)
 
 
 
 
 
 
823
 
824
  elif st.session_state.current_index == len(st.session_state.data):
825
  st.write(f"**Thank you for taking part in this study!** \n ")