Skip to content

Instantly share code, notes, and snippets.

@WilCF
Created May 7, 2014 17:52
Show Gist options
  • Save WilCF/dbdacb34f6f11fcd5664 to your computer and use it in GitHub Desktop.
Save WilCF/dbdacb34f6f11fcd5664 to your computer and use it in GitHub Desktop.
when I use the /jobs/{job_id}/units/{unit_id} endpoint to create or update a unit to add gold, I am having trouble specifying more than one answer 2:09
the whole array ends up quoted
or should I just repeat unit[data][field_golden]=x&unit[data][field_golden]=y to give both answers?
I have been doing unit[data][field_golden]=[x,y] 2:10
Wil Stevens sure - I know we separate them by a newline character 2:11
which is often /n
Christopher Hundt you mean unit[data][field_golden]=[x\ny] ?
or rather unit[data][field_golden]=x\ny?
Wil Stevens the latter 2:13
Christopher Hundt that did not seem to work 2:15
see 458989249
looks like it only got the second answer
because when i click "edit test question" only that one is checked
Wil Stevens sure
well, we can do this backwards right?
create a test question with multiple answers in the GUI
Christopher Hundt yes 2:17
it shows them in an array
like http://api.crowdflower.com/v1/jobs/397732/units/424611959.json
but when I send that array back it doesn't work
"sending the array back" is liked oing unit[data][field_golden]=[x,y]
*like doing
and that just creates one answer with the whole thing quoted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment