Spaces:
Sleeping
Sleeping
app
Browse files
app.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
import json
|
| 2 |
import os
|
| 3 |
import random
|
| 4 |
from collections import Counter
|
|
@@ -177,7 +176,8 @@ async def get(question_type: str = None):
|
|
| 177 |
hx_post="/evaluate",
|
| 178 |
hx_target="#example-details",
|
| 179 |
),
|
| 180 |
-
Hidden(name="example", value=json.dumps(example)),
|
|
|
|
| 181 |
id="evaluation-form",
|
| 182 |
),
|
| 183 |
id="example-container",
|
|
@@ -211,8 +211,9 @@ async def get():
|
|
| 211 |
|
| 212 |
|
| 213 |
@rt("/evaluate")
|
| 214 |
-
async def post(decision: str,
|
| 215 |
-
|
|
|
|
| 216 |
|
| 217 |
# Insert the evaluated example into the database
|
| 218 |
examples.insert(
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
import random
|
| 3 |
from collections import Counter
|
|
|
|
| 176 |
hx_post="/evaluate",
|
| 177 |
hx_target="#example-details",
|
| 178 |
),
|
| 179 |
+
# Hidden(name="example", value=json.dumps(example)),
|
| 180 |
+
Hidden(name="example_id", value=str(example["example_id"])),
|
| 181 |
id="evaluation-form",
|
| 182 |
),
|
| 183 |
id="example-container",
|
|
|
|
| 211 |
|
| 212 |
|
| 213 |
@rt("/evaluate")
|
| 214 |
+
async def post(decision: str, example_id: str):
|
| 215 |
+
example_id = int(example_id)
|
| 216 |
+
example_dict = fact_dataset[example_id]
|
| 217 |
|
| 218 |
# Insert the evaluated example into the database
|
| 219 |
examples.insert(
|