mojakob commited on
Commit
0696f29
·
verified ·
1 Parent(s): 959736b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import os
2
  import openai
3
  import gradio as gr
@@ -905,7 +906,7 @@ def new_chat_input(chat_history, user_state, user_input, *args, **kwargs):
905
 
906
  # else we are now at the Additional Comments question:
907
  # response = "Do you have any additional comments about your experience? (Type 'no' if none.)"
908
- response = "You are taking part in a pilot version of this study. Do you have any comments or suggestions on how this assessment could be improved for other users? (Type 'no' if none.)"
909
  chat_history[-1] = (user_input, response)
910
  user_state["usability_question_counter"] = 5
911
  return (
@@ -1669,15 +1670,18 @@ with gr.Blocks(theme= gr.themes.Glass(), css=css) as app:
1669
  user_state["gad_score"] = g1 + g2 + g3 + g4 + g5 + g6 + g7
1670
  combined_score = user_state["phq_score"] + user_state["gad_score"]
1671
 
1672
- if combined_score > 20:
1673
- # Show rejection message and provide the Prolific rejection link
1674
  rejection_link = "https://app.prolific.com/submissions/complete?cc=C11ALNAE"
 
 
 
 
1675
  return (
1676
- f"Unfortunately, your score exceeds the inclusion threshold. You do not meet the criteria for this study. "
1677
- f"Please use the following link to complete your submission on Prolific: {rejection_link}",
1678
- gr.update(visible=False), # Hide page_3
1679
- gr.update(visible=False), # Hide page_1 (briefing)
1680
- user_state,)
1681
 
1682
  user_state["eligible"] = True
1683
 
 
1
+
2
  import os
3
  import openai
4
  import gradio as gr
 
906
 
907
  # else we are now at the Additional Comments question:
908
  # response = "Do you have any additional comments about your experience? (Type 'no' if none.)"
909
+ response = "Lastly, do you have any additional comments or feedback regarding your experience? (Type 'no' if none.)"
910
  chat_history[-1] = (user_input, response)
911
  user_state["usability_question_counter"] = 5
912
  return (
 
1670
  user_state["gad_score"] = g1 + g2 + g3 + g4 + g5 + g6 + g7
1671
  combined_score = user_state["phq_score"] + user_state["gad_score"]
1672
 
1673
+ if combined_score > 25:
 
1674
  rejection_link = "https://app.prolific.com/submissions/complete?cc=C11ALNAE"
1675
+ rejection_message = (
1676
+ f"Unfortunately, your combined score indicates that you do not meet the inclusion criteria for this study. "
1677
+ f"Please complete your submission on Prolific using the following link: {rejection_link}"
1678
+ )
1679
  return (
1680
+ rejection_message,
1681
+ gr.update(visible=True), # page_3
1682
+ gr.update(visible=False), # page_4
1683
+ user_state,
1684
+ )
1685
 
1686
  user_state["eligible"] = True
1687