Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -4
src/streamlit_app.py
CHANGED
|
@@ -48,8 +48,9 @@ scheduler = CommitScheduler(
|
|
| 48 |
# f.write("\n")
|
| 49 |
#====
|
| 50 |
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
cont_r = 0
|
| 53 |
|
| 54 |
# ---- CONFIG ----
|
| 55 |
st.set_page_config(page_title="Image Preference Study", layout="centered")
|
|
@@ -102,14 +103,14 @@ if st.button("Submit"):
|
|
| 102 |
if results[key] == "-":
|
| 103 |
cont += 1
|
| 104 |
|
| 105 |
-
if code_prov
|
| 106 |
st.error("Please, insert your provided code at the beginning of this form. Then, try submitting again.")
|
| 107 |
elif cont != 0:
|
| 108 |
st.error("Sorry, you have not evaluated all pairs. Please, check again.")
|
| 109 |
else:
|
| 110 |
-
if cont_r == 0:
|
| 111 |
|
| 112 |
-
cont_r += 1
|
| 113 |
#st.success("Thank you! Your responses have been recorded.")
|
| 114 |
#st.write("Thank you! Your selection has been recorded.")
|
| 115 |
st.success("Thank you! Your selection has been recorded.")
|
|
|
|
| 48 |
# f.write("\n")
|
| 49 |
#====
|
| 50 |
|
| 51 |
+
if 'cont_r' not in st.session_state:
|
| 52 |
+
st.session_state.cont_r = 0
|
| 53 |
|
|
|
|
| 54 |
|
| 55 |
# ---- CONFIG ----
|
| 56 |
st.set_page_config(page_title="Image Preference Study", layout="centered")
|
|
|
|
| 103 |
if results[key] == "-":
|
| 104 |
cont += 1
|
| 105 |
|
| 106 |
+
if code_prov == "":
|
| 107 |
st.error("Please, insert your provided code at the beginning of this form. Then, try submitting again.")
|
| 108 |
elif cont != 0:
|
| 109 |
st.error("Sorry, you have not evaluated all pairs. Please, check again.")
|
| 110 |
else:
|
| 111 |
+
if st.session_state.cont_r == 0:
|
| 112 |
|
| 113 |
+
st.session_state.cont_r += 1
|
| 114 |
#st.success("Thank you! Your responses have been recorded.")
|
| 115 |
#st.write("Thank you! Your selection has been recorded.")
|
| 116 |
st.success("Thank you! Your selection has been recorded.")
|