Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -158,9 +158,9 @@ def submit_answer(category, num_categories, num_questions, questions, index, use
|
|
| 158 |
user_answers.append({
|
| 159 |
"Question": question_data["question"],
|
| 160 |
"Explanation": question_data["explanation"],
|
| 161 |
-
"User Answer":
|
| 162 |
"Correct Answer": question_data["answer"],
|
| 163 |
-
"Confidence": confidence,
|
| 164 |
"Subcategory": subcategory
|
| 165 |
})
|
| 166 |
index += 1
|
|
@@ -230,7 +230,7 @@ with gr.Blocks(theme="soft") as app:
|
|
| 230 |
index,
|
| 231 |
[],
|
| 232 |
gr.update(visible=visible),
|
| 233 |
-
gr.update(visible=
|
| 234 |
gr.update(visible=True, value=0.5),
|
| 235 |
gr.update(visible=True),
|
| 236 |
gr.update(visible=False),
|
|
|
|
| 158 |
user_answers.append({
|
| 159 |
"Question": question_data["question"],
|
| 160 |
"Explanation": question_data["explanation"],
|
| 161 |
+
"User Answer": confidence > 0.5,
|
| 162 |
"Correct Answer": question_data["answer"],
|
| 163 |
+
"Confidence": 2*abs(confidence-0.5),
|
| 164 |
"Subcategory": subcategory
|
| 165 |
})
|
| 166 |
index += 1
|
|
|
|
| 230 |
index,
|
| 231 |
[],
|
| 232 |
gr.update(visible=visible),
|
| 233 |
+
gr.update(visible=False, value=None),
|
| 234 |
gr.update(visible=True, value=0.5),
|
| 235 |
gr.update(visible=True),
|
| 236 |
gr.update(visible=False),
|