Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,7 +56,7 @@ if menu == "Poll":
|
|
56 |
if st.session_state.step == 1:
|
57 |
st.header("Step 1: Enter your name")
|
58 |
name = st.text_input("Name:")
|
59 |
-
if st.button("Next") and name:
|
60 |
st.session_state.users.append(name)
|
61 |
st.session_state.step = 2
|
62 |
|
@@ -69,7 +69,7 @@ if menu == "Poll":
|
|
69 |
"Italiano", "Café con soja", "Té", "Manzanilla", "Nada"
|
70 |
]
|
71 |
selected_drinks = st.multiselect("Choose your drinks:", drinks_options)
|
72 |
-
if st.button("Next") and selected_drinks:
|
73 |
st.session_state.current_selections.append({"Name": st.session_state.users[-1], "Drinks": selected_drinks})
|
74 |
st.session_state.step = 3
|
75 |
|
@@ -81,7 +81,7 @@ if menu == "Poll":
|
|
81 |
"Palmera de chocolate blanco", "Yogurt", "Pincho de tortilla", "Nada"
|
82 |
]
|
83 |
selected_food = st.multiselect("Choose your food:", food_options)
|
84 |
-
if st.button("Next") and selected_food:
|
85 |
st.session_state.current_selections[-1]["Food"] = selected_food
|
86 |
st.session_state.step = 4
|
87 |
|
@@ -92,7 +92,7 @@ if menu == "Poll":
|
|
92 |
df = pd.DataFrame(st.session_state.current_selections)
|
93 |
st.table(df)
|
94 |
|
95 |
-
if st.button("Submit Summary"):
|
96 |
# Save the current summary to a text file in the history directory
|
97 |
save_summary_to_file(df)
|
98 |
|
|
|
56 |
if st.session_state.step == 1:
|
57 |
st.header("Step 1: Enter your name")
|
58 |
name = st.text_input("Name:")
|
59 |
+
if st.button("Next", key="step1_next") and name: # Unique key for the button
|
60 |
st.session_state.users.append(name)
|
61 |
st.session_state.step = 2
|
62 |
|
|
|
69 |
"Italiano", "Café con soja", "Té", "Manzanilla", "Nada"
|
70 |
]
|
71 |
selected_drinks = st.multiselect("Choose your drinks:", drinks_options)
|
72 |
+
if st.button("Next", key="step2_next") and selected_drinks: # Unique key for the button
|
73 |
st.session_state.current_selections.append({"Name": st.session_state.users[-1], "Drinks": selected_drinks})
|
74 |
st.session_state.step = 3
|
75 |
|
|
|
81 |
"Palmera de chocolate blanco", "Yogurt", "Pincho de tortilla", "Nada"
|
82 |
]
|
83 |
selected_food = st.multiselect("Choose your food:", food_options)
|
84 |
+
if st.button("Next", key="step3_next") and selected_food: # Unique key for the button
|
85 |
st.session_state.current_selections[-1]["Food"] = selected_food
|
86 |
st.session_state.step = 4
|
87 |
|
|
|
92 |
df = pd.DataFrame(st.session_state.current_selections)
|
93 |
st.table(df)
|
94 |
|
95 |
+
if st.button("Submit Summary", key="submit_summary"): # Unique key for the button
|
96 |
# Save the current summary to a text file in the history directory
|
97 |
save_summary_to_file(df)
|
98 |
|