Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -306,7 +306,8 @@ elif st.session_state["current_page"] == 7:
|
|
| 306 |
|
| 307 |
st.progress(st.session_state["current_page"]/total_number_pages, text="Progress")
|
| 308 |
|
| 309 |
-
|
|
|
|
| 310 |
st.markdown('<p class="big-font">Thank you for participating! <br> Click on the button below to submit your answers. </p>', unsafe_allow_html=True)
|
| 311 |
st.button('Submit Responses', disabled = st.session_state["disabled"], on_click = button_disable)
|
| 312 |
if st.session_state["disabled"]:
|
|
@@ -315,10 +316,10 @@ elif st.session_state["current_page"] == 8:
|
|
| 315 |
response = {'file': json.dumps({
|
| 316 |
"Q1": st.session_state["Q1"],
|
| 317 |
"Q2": st.session_state["Q2"],
|
| 318 |
-
"Q3":
|
| 319 |
"Q4": Q4_radio_options[st.session_state["Q4"]],
|
| 320 |
"Q5": Q5_radio_options[st.session_state["Q5"]],
|
| 321 |
-
"Q6":
|
| 322 |
"Q7": st.session_state["Q7"],
|
| 323 |
"Q8": st.session_state["Q8"],
|
| 324 |
"Q9": Q9_radio_options[st.session_state["Q9"]],
|
|
@@ -326,17 +327,16 @@ elif st.session_state["current_page"] == 8:
|
|
| 326 |
except Exception as e:
|
| 327 |
print(e)
|
| 328 |
st.error(f'An error ocurred. Here is the error message: {e}', icon="🚨")
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
st.markdown(st.session_state["Q1"], unsafe_allow_html=True)
|
| 333 |
st.markdown(st.session_state["Q2"], unsafe_allow_html=True)
|
| 334 |
st.markdown(st.session_state["Q3"], unsafe_allow_html=True)
|
| 335 |
st.markdown(Q4_radio_options[st.session_state["Q4"]], unsafe_allow_html=True)
|
| 336 |
st.markdown(Q5_radio_options[st.session_state["Q5"]], unsafe_allow_html=True)
|
| 337 |
-
st.markdown(
|
| 338 |
st.markdown(st.session_state["Q7"], unsafe_allow_html=True)
|
| 339 |
st.markdown(st.session_state["Q8"], unsafe_allow_html=True)
|
| 340 |
st.markdown(Q9_radio_options[st.session_state["Q9"]], unsafe_allow_html=True)
|
| 341 |
-
|
|
|
|
|
|
|
| 342 |
st.progress(st.session_state["current_page"]/total_number_pages, text="Progress")
|
|
|
|
| 306 |
|
| 307 |
st.progress(st.session_state["current_page"]/total_number_pages, text="Progress")
|
| 308 |
|
| 309 |
+
|
| 310 |
+
elif st.session_state["current_page"] == 8:
|
| 311 |
st.markdown('<p class="big-font">Thank you for participating! <br> Click on the button below to submit your answers. </p>', unsafe_allow_html=True)
|
| 312 |
st.button('Submit Responses', disabled = st.session_state["disabled"], on_click = button_disable)
|
| 313 |
if st.session_state["disabled"]:
|
|
|
|
| 316 |
response = {'file': json.dumps({
|
| 317 |
"Q1": st.session_state["Q1"],
|
| 318 |
"Q2": st.session_state["Q2"],
|
| 319 |
+
"Q3": st.session_state["Q3"],
|
| 320 |
"Q4": Q4_radio_options[st.session_state["Q4"]],
|
| 321 |
"Q5": Q5_radio_options[st.session_state["Q5"]],
|
| 322 |
+
"Q6": st.session_state["Q6"],
|
| 323 |
"Q7": st.session_state["Q7"],
|
| 324 |
"Q8": st.session_state["Q8"],
|
| 325 |
"Q9": Q9_radio_options[st.session_state["Q9"]],
|
|
|
|
| 327 |
except Exception as e:
|
| 328 |
print(e)
|
| 329 |
st.error(f'An error ocurred. Here is the error message: {e}', icon="🚨")
|
|
|
|
|
|
|
|
|
|
| 330 |
st.markdown(st.session_state["Q1"], unsafe_allow_html=True)
|
| 331 |
st.markdown(st.session_state["Q2"], unsafe_allow_html=True)
|
| 332 |
st.markdown(st.session_state["Q3"], unsafe_allow_html=True)
|
| 333 |
st.markdown(Q4_radio_options[st.session_state["Q4"]], unsafe_allow_html=True)
|
| 334 |
st.markdown(Q5_radio_options[st.session_state["Q5"]], unsafe_allow_html=True)
|
| 335 |
+
st.markdown(st.session_state["Q6"], unsafe_allow_html=True)
|
| 336 |
st.markdown(st.session_state["Q7"], unsafe_allow_html=True)
|
| 337 |
st.markdown(st.session_state["Q8"], unsafe_allow_html=True)
|
| 338 |
st.markdown(Q9_radio_options[st.session_state["Q9"]], unsafe_allow_html=True)
|
| 339 |
+
if st.button('Back'):
|
| 340 |
+
st.session_state["current_page"] -= 1
|
| 341 |
+
st.rerun()
|
| 342 |
st.progress(st.session_state["current_page"]/total_number_pages, text="Progress")
|