Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,7 @@ async def update_validation_space_on_answer(response, type, timestamp):
|
|
21 |
incoming_events.put({"event": type, "timestamp": str(timestamp)})
|
22 |
|
23 |
record = response.record
|
|
|
24 |
|
25 |
dataset_name = record.dataset.name
|
26 |
if not dataset_name.endswith("Responder"):
|
@@ -37,15 +38,15 @@ async def update_validation_space_on_answer(response, type, timestamp):
|
|
37 |
print(f"Error connecting to validation dataset: {e}")
|
38 |
|
39 |
response_dict = response.to_dict()
|
40 |
-
|
41 |
-
answer_2
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
|
46 |
new_records = []
|
47 |
|
48 |
-
for answer in
|
49 |
if answer:
|
50 |
validation_record = {
|
51 |
"question": record.fields["question"],
|
|
|
21 |
incoming_events.put({"event": type, "timestamp": str(timestamp)})
|
22 |
|
23 |
record = response.record
|
24 |
+
original_user_id = str(response.user_id)
|
25 |
|
26 |
dataset_name = record.dataset.name
|
27 |
if not dataset_name.endswith("Responder"):
|
|
|
38 |
print(f"Error connecting to validation dataset: {e}")
|
39 |
|
40 |
response_dict = response.to_dict()
|
41 |
+
answers = [response_dict["values"]['answer_1']['value']]
|
42 |
+
if "answer_2" in response_dict["values"]:
|
43 |
+
answers.append(response_dict["values"]['answer_2']['value'])
|
44 |
+
if "answer_3" in response_dict["values"]:
|
45 |
+
answers.append(response_dict["values"]['answer_3']['value'])
|
46 |
|
47 |
new_records = []
|
48 |
|
49 |
+
for answer in answers:
|
50 |
if answer:
|
51 |
validation_record = {
|
52 |
"question": record.fields["question"],
|