elibrowne commited on
Commit
e525095
·
1 Parent(s): a73219f

Forces yes/no before submit of score

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -127,7 +127,14 @@ with gr.Blocks(theme = theme) as user_eval:
127
  eval_2 = gr.Slider(1, 5, step = 0.5, label = "Quality")
128
  desc_3 = gr.Markdown("How effectively does the passage **lead you to the correct answer?**")
129
  eval_3 = gr.Slider(1, 5, step = 0.5, label = "Helpfulness")
130
- btn_p = gr.Button("Next")
 
 
 
 
 
 
 
131
 
132
  with gr.Column(scale = 1, visible = False) as scores_g:
133
  helps = gr.Markdown("Does this information **help answer** the question?")
 
127
  eval_2 = gr.Slider(1, 5, step = 0.5, label = "Quality")
128
  desc_3 = gr.Markdown("How effectively does the passage **lead you to the correct answer?**")
129
  eval_3 = gr.Slider(1, 5, step = 0.5, label = "Helpfulness")
130
+ btn_p = gr.Button("Next", interactive = False)
131
+ # Users must enter in a yes/no value before moving on
132
+ def sanitize_score(rad):
133
+ if rad == None:
134
+ return {btn_p: gr.Button(interactive = False)}
135
+ else:
136
+ return {btn_p: gr.Button(interactive = True)}
137
+ eval_0.change(fn = sanitize_score, inputs = [eval_0], outputs = [btn_p])
138
 
139
  with gr.Column(scale = 1, visible = False) as scores_g:
140
  helps = gr.Markdown("Does this information **help answer** the question?")