Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -328,13 +328,13 @@ def show_field(f: Field, index: int, data_collected):
|
|
328 |
value=value, help=f.help)
|
329 |
case 'multiselect':
|
330 |
choices = default_choices if not f.other_params.get('choices') else f.other_params.get('choices')
|
331 |
-
selected_values = st.session_state
|
332 |
-
|
333 |
-
|
334 |
-
options = choices,
|
335 |
format_func=lambda x: x,
|
336 |
key=key, max_selections=3,
|
337 |
help=f.help)
|
|
|
338 |
case 'likert_radio':
|
339 |
labels = default_labels if not f.other_params.get('labels') else f.other_params.get('labels')
|
340 |
st.radio(f.title,
|
|
|
328 |
value=value, help=f.help)
|
329 |
case 'multiselect':
|
330 |
choices = default_choices if not f.other_params.get('choices') else f.other_params.get('choices')
|
331 |
+
selected_values = st.session_state.get(key, data_collected.get(f.name, []))
|
332 |
+
selected_values = st.multiselect(f.title,
|
333 |
+
options = choices, default=selected_values,
|
|
|
334 |
format_func=lambda x: x,
|
335 |
key=key, max_selections=3,
|
336 |
help=f.help)
|
337 |
+
st.session_state[key] = selected_values
|
338 |
case 'likert_radio':
|
339 |
labels = default_labels if not f.other_params.get('labels') else f.other_params.get('labels')
|
340 |
st.radio(f.title,
|