Created
April 10, 2012 23:40
-
-
Save hampelm/2355659 to your computer and use it in GitHub Desktop.
Proposed response structure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I feel like the responses datatype should be simplified from its current form, pasted here: | |
var data = { | |
responses: [ | |
{ parcels: [ {parcel_id: '10', responses: {'Q0': 0, 'Q1': 3}} ] }, | |
{ parcels: [ {parcel_id: '11', responses: {'Q0': 1, 'Q1': 4}} ] } | |
] | |
}; | |
// To one without the additional {parcels: } object, which doesn't seem to add much: | |
var data = { | |
responses: [ | |
{parcel_id: '10', responses: {'Q0': 0, 'Q1': 3}}, | |
{parcel_id: '11', responses: {'Q0': 0, 'Q1': 3}}, | |
{parcel_id: '12', responses: {'Q0': 0, 'Q1': 3}}, | |
] | |
}; | |
// Alternately, we could make parcel_id a list: | |
var data = { | |
responses: [ | |
{parcel_ids: ['10', '11'], responses: {'Q0': 0, 'Q1': 3}}, | |
] | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment