Update app.py
Browse files
app.py
CHANGED
@@ -142,26 +142,24 @@ def create_interface():
|
|
142 |
gr.Markdown("Please rate the following statements on a scale from **1 (Disagree a lot)** to **5 (Agree a lot)**. If you prefer not to respond to a particular statement, select **'No response'**.")
|
143 |
|
144 |
# Create a grid layout for better organization
|
145 |
-
with gr.
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
value="No response"
|
155 |
-
)
|
156 |
-
dropdowns.append(dropdown)
|
157 |
|
158 |
# Submit button
|
159 |
submit_btn = gr.Button("Submit")
|
160 |
-
|
161 |
-
|
162 |
# Results display
|
163 |
result = gr.Markdown()
|
164 |
-
|
|
|
|
|
165 |
|
166 |
return demo
|
167 |
|
|
|
142 |
gr.Markdown("Please rate the following statements on a scale from **1 (Disagree a lot)** to **5 (Agree a lot)**. If you prefer not to respond to a particular statement, select **'No response'**.")
|
143 |
|
144 |
# Create a grid layout for better organization
|
145 |
+
with gr.Column():
|
146 |
+
dropdowns = []
|
147 |
+
for q in questions:
|
148 |
+
dropdown = gr.Dropdown(
|
149 |
+
choices=["No response", 1, 2, 3, 4, 5],
|
150 |
+
label=q,
|
151 |
+
value="No response"
|
152 |
+
)
|
153 |
+
dropdowns.append(dropdown)
|
|
|
|
|
|
|
154 |
|
155 |
# Submit button
|
156 |
submit_btn = gr.Button("Submit")
|
157 |
+
|
|
|
158 |
# Results display
|
159 |
result = gr.Markdown()
|
160 |
+
|
161 |
+
# Link the button to the function
|
162 |
+
submit_btn.click(fn=compute_bfi_scores, inputs=dropdowns, outputs=result)
|
163 |
|
164 |
return demo
|
165 |
|