ouhenio commited on
Commit
06378db
·
verified ·
1 Parent(s): 0e57e89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -51,11 +51,11 @@ async def update_validation_space_on_answer(response, type, timestamp):
51
  from build_space import create_validation_space
52
  validation_dataset = create_validation_space(country)
53
 
54
- print(response)
55
-
56
  response_dict = response.to_dict()
57
- print("response dict", response_dict)
58
  answer = response_dict["values"]['text']['value']
 
 
 
59
 
60
  # Create a validation record with the correct attribute
61
  # Instead of response.value, we need to find the correct attribute
@@ -63,6 +63,10 @@ async def update_validation_space_on_answer(response, type, timestamp):
63
  validation_record = {
64
  "question": record.fields["question"],
65
  "answer": answer,
 
 
 
 
66
  }
67
 
68
  # Add the record to the validation space
 
51
  from build_space import create_validation_space
52
  validation_dataset = create_validation_space(country)
53
 
 
 
54
  response_dict = response.to_dict()
 
55
  answer = response_dict["values"]['text']['value']
56
+
57
+ # Get the user ID of the original responder
58
+ original_user_id = str(response.user_id)
59
 
60
  # Create a validation record with the correct attribute
61
  # Instead of response.value, we need to find the correct attribute
 
63
  validation_record = {
64
  "question": record.fields["question"],
65
  "answer": answer,
66
+ "metadata": {
67
+ "original_responder_id": original_user_id,
68
+ "original_dataset": dataset_name
69
+ }
70
  }
71
 
72
  # Add the record to the validation space