Spaces:
Sleeping
Sleeping
Yara Kyrychenko
commited on
Commit
Β·
1e33da4
1
Parent(s):
1b5f7d6
upd submit interaction and del code
Browse files
app.py
CHANGED
|
@@ -114,17 +114,15 @@ with st.sidebar:
|
|
| 114 |
|
| 115 |
β Do not use AI tools to generate your responses; write them yourself.
|
| 116 |
|
| 117 |
-
β οΈ You must respond **at least 5 times** before you will see a *
|
| 118 |
|
| 119 |
β If you encounter any technical issues, please let us know. It might sometimes take 30 seconds or more to generate a response, so please be patient.
|
| 120 |
|
| 121 |
-
{"β" if st.session_state.inserted > 1 else "β"} **Step 3.
|
| 122 |
-
|
| 123 |
-
β οΈ Do not forget to copy & paste your completion code!
|
| 124 |
|
| 125 |
βΊ You can always return to this panel by clicking the arrow on the top left.
|
| 126 |
|
| 127 |
-
{"π **All done! Please
|
| 128 |
""")
|
| 129 |
if st.session_state.gotit == False or st.session_state.submitted == False:
|
| 130 |
st.session_state.gotit = st.button("Let's start!", key=None, help=None, use_container_width=True)
|
|
@@ -206,18 +204,16 @@ elif st.session_state.submitted == False:
|
|
| 206 |
pass
|
| 207 |
|
| 208 |
elif st.session_state.inserted > 1:
|
| 209 |
-
st.markdown("##
|
| 210 |
-
st.markdown('**
|
| 211 |
-
st.markdown(f'## {st.session_state.user_id}')
|
| 212 |
-
st.markdown('**Please copy the code and enter it into the survey field below.**')
|
| 213 |
|
| 214 |
elif st.query_params["p"] == "n":
|
| 215 |
-
st.markdown("""**You have not been selected to have a conversation with the chatbot.**
|
| 216 |
-
Please press *
|
| 217 |
""")
|
| 218 |
columns = st.columns((1,1,1))
|
| 219 |
with columns[2]:
|
| 220 |
-
if st.button("
|
| 221 |
keys = ["inserted", "messages", "convo_start_time"]
|
| 222 |
|
| 223 |
st.session_state.user_data.update({key: st.session_state[key] for key in keys})
|
|
@@ -271,7 +267,7 @@ elif prompt := st.chat_input("Ask a question about climate action..."):
|
|
| 271 |
if len(st.session_state.messages) > 10 or st.session_state.max_messages == len(st.session_state.messages):
|
| 272 |
columns = st.columns((1,1,1))
|
| 273 |
with columns[2]:
|
| 274 |
-
if st.button("
|
| 275 |
keys = ["inserted", "messages", "convo_start_time"]
|
| 276 |
|
| 277 |
st.session_state.user_data.update({key: st.session_state[key] for key in keys})
|
|
|
|
| 114 |
|
| 115 |
β Do not use AI tools to generate your responses; write them yourself.
|
| 116 |
|
| 117 |
+
β οΈ You must respond **at least 5 times** before you will see a *Submit Interaction* button. You can continue before submitting, but **you must click *Submit Interaction* to receive compensation**.
|
| 118 |
|
| 119 |
β If you encounter any technical issues, please let us know. It might sometimes take 30 seconds or more to generate a response, so please be patient.
|
| 120 |
|
| 121 |
+
{"β" if st.session_state.inserted > 1 else "β"} **Step 3. Press the *Submit Interaction* button**
|
|
|
|
|
|
|
| 122 |
|
| 123 |
βΊ You can always return to this panel by clicking the arrow on the top left.
|
| 124 |
|
| 125 |
+
{"π **All done! Please press *Next* in the survey.**" if st.session_state.inserted > 1 else ""}
|
| 126 |
""")
|
| 127 |
if st.session_state.gotit == False or st.session_state.submitted == False:
|
| 128 |
st.session_state.gotit = st.button("Let's start!", key=None, help=None, use_container_width=True)
|
|
|
|
| 204 |
pass
|
| 205 |
|
| 206 |
elif st.session_state.inserted > 1:
|
| 207 |
+
st.markdown("## Please press *Next* in the survey to proceed.")
|
| 208 |
+
st.markdown('β **This is not the end of the study.**')
|
|
|
|
|
|
|
| 209 |
|
| 210 |
elif st.query_params["p"] == "n":
|
| 211 |
+
st.markdown("""**You have (randomly) not been selected to have a conversation with the chatbot.**
|
| 212 |
+
Please press *Submit Interaction* to get your completion code.
|
| 213 |
""")
|
| 214 |
columns = st.columns((1,1,1))
|
| 215 |
with columns[2]:
|
| 216 |
+
if st.button("Submit Interaction",use_container_width=True):
|
| 217 |
keys = ["inserted", "messages", "convo_start_time"]
|
| 218 |
|
| 219 |
st.session_state.user_data.update({key: st.session_state[key] for key in keys})
|
|
|
|
| 267 |
if len(st.session_state.messages) > 10 or st.session_state.max_messages == len(st.session_state.messages):
|
| 268 |
columns = st.columns((1,1,1))
|
| 269 |
with columns[2]:
|
| 270 |
+
if st.button("Submit Interaction",use_container_width=True, type="primary"):
|
| 271 |
keys = ["inserted", "messages", "convo_start_time"]
|
| 272 |
|
| 273 |
st.session_state.user_data.update({key: st.session_state[key] for key in keys})
|