Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -490,11 +490,6 @@ def prime_rupture_markers_from_saved(index: int, data_collected: dict | None):
|
|
| 490 |
st.session_state[primed_flag] = True
|
| 491 |
|
| 492 |
def validate_current_page(fields: List[Field], index: int) -> bool:
|
| 493 |
-
"""
|
| 494 |
-
Walk the field tree and verify mandatory inputs are filled.
|
| 495 |
-
Honors `following_mandatory_values`: if a field's value is in that list,
|
| 496 |
-
subsequent siblings become mandatory.
|
| 497 |
-
"""
|
| 498 |
ok = True
|
| 499 |
|
| 500 |
def walk(nodes: List[Field], following_required: bool = False):
|
|
@@ -785,7 +780,7 @@ def prep_and_save_data(index, skip_sample, completed: bool):
|
|
| 785 |
'user_id': st.session_state.user_id,
|
| 786 |
'index': st.session_state.current_index,
|
| 787 |
**(st.session_state.data.iloc[index][COLS_TO_SAVE].to_dict() if 0 <= index < len(st.session_state.data) else {}),
|
| 788 |
-
|
| 789 |
'skip': skip_sample,
|
| 790 |
'completed': completed,
|
| 791 |
}
|
|
@@ -890,7 +885,7 @@ if 'current_index' not in st.session_state:
|
|
| 890 |
st.session_state.current_index = start_index+1
|
| 891 |
st.session_state.form_displayed = -2
|
| 892 |
|
| 893 |
-
data = read_saved_data(
|
| 894 |
if data is None:
|
| 895 |
st.session_state.step = 0
|
| 896 |
else:
|
|
@@ -909,7 +904,6 @@ if get_param_from_url('show_extra_fields'):
|
|
| 909 |
else:
|
| 910 |
fields1 += url_conditional_fields
|
| 911 |
|
| 912 |
-
|
| 913 |
def add_validated_submit(fields, message):
|
| 914 |
st.session_state.form_displayed = st.session_state.current_index
|
| 915 |
if st.form_submit_button("Submit"):
|
|
|
|
| 490 |
st.session_state[primed_flag] = True
|
| 491 |
|
| 492 |
def validate_current_page(fields: List[Field], index: int) -> bool:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 493 |
ok = True
|
| 494 |
|
| 495 |
def walk(nodes: List[Field], following_required: bool = False):
|
|
|
|
| 780 |
'user_id': st.session_state.user_id,
|
| 781 |
'index': st.session_state.current_index,
|
| 782 |
**(st.session_state.data.iloc[index][COLS_TO_SAVE].to_dict() if 0 <= index < len(st.session_state.data) else {}),
|
| 783 |
+
#**{k: st.session_state[k + str(index)] for k in st.session_state.data_inputs_keys},
|
| 784 |
'skip': skip_sample,
|
| 785 |
'completed': completed,
|
| 786 |
}
|
|
|
|
| 885 |
st.session_state.current_index = start_index+1
|
| 886 |
st.session_state.form_displayed = -2
|
| 887 |
|
| 888 |
+
data = read_saved_data()
|
| 889 |
if data is None:
|
| 890 |
st.session_state.step = 0
|
| 891 |
else:
|
|
|
|
| 904 |
else:
|
| 905 |
fields1 += url_conditional_fields
|
| 906 |
|
|
|
|
| 907 |
def add_validated_submit(fields, message):
|
| 908 |
st.session_state.form_displayed = st.session_state.current_index
|
| 909 |
if st.form_submit_button("Submit"):
|