Questions and responses
The questionnaire section holds two lists. questions defines what was asked. responses records what one participant gave.
{ "key": "cookie-evaluation", "name": "Cookie evaluation", "locale": "en_US", "questions": [ { "key": "overall-liking", "type": "choice", "display": "radio", "exclusive": true, "text": "How much did you like this cookie?", "options": [ { "key": "like-5", "name": "Like very much", "score": 5 }, { "key": "like-4", "name": "Like slightly", "score": 4 } ] } ], "repetition": { "key": "member-17-cookie-a-1" }, "responses": [ { "question_key": "overall-liking", "response": [{ "option_key": "like-4" }] } ]}repetition identifies this participant’s pass through the questionnaire. See Keys and replacement.
Define a question
Section titled “Define a question”| Field | Meaning |
|---|---|
key |
The question’s identity within the questionnaire |
name |
The question’s reporting name, when it has one |
type |
What kind of response the question collects |
display |
The RedJade question type the participant saw |
exclusive |
For choice and grid: true when only one option can be selected |
text |
The question’s wording |
options |
The fixed list of options, each with key, name, and optional score |
rows |
For grid: the items being rated, each with key and name. A semantic_differential_scale row also has end_name, the label at the opposite end of its scale. |
min, max |
For numeric: the ends of the scale |
media |
Images or video shown with the question, each with url and content_type. An option can carry media too. |
type is one of six values and says how to parse the response. display is the RedJade question type, and each one belongs to exactly one type:
type |
Collects | display values |
|---|---|---|
choice |
One or more options from a list | radio, checkbox, select, demographic |
numeric |
A number | numeric, range, star_rating |
text |
Typed text | text |
media |
Uploaded files | media_upload |
grid |
An option or a number for each row | single_response_grid, multiple_response_grid, star_rating_grid, numeric_grid, card_swiper, semantic_differential_scale |
ranking |
The options in order | ranking |
display holds the value that Download study data returns as question_type, with one spelling difference listed in Question types. It does not change the response’s shape. When you send a question, display is optional. See Question types for the name each one has in the survey builder.
The response object
Section titled “The response object”Every response uses the same object. All of its fields are optional, and the question’s type determines which ones appear.
| Field | Meaning |
|---|---|
option_key |
The option the participant selected |
row_key |
The grid row this response belongs to |
text |
Text the participant typed |
score |
A number the participant gave |
rank |
The position the participant gave an option, starting at 1 |
url |
Where to download an uploaded file |
content_type |
The uploaded file’s media type |
answered_at |
When the participant gave this response |
A question’s response is always a list of these objects:
type |
response |
|---|---|
choice, one option |
[{ "option_key": "like-4" }] |
choice, several options |
[{ "option_key": "home" }, { "option_key": "work" }] |
choice with typed text |
[{ "option_key": "other", "text": "My local bakery" }] |
numeric |
[{ "score": 62 }] |
text |
[{ "text": "A little too sweet for me." }] |
media |
[{ "url": "https://…", "content_type": "image/jpeg" }], one object per file |
grid of options |
[{ "row_key": "taste", "option_key": "like-4" }, { "row_key": "texture", "option_key": "like-5" }] |
grid of numbers |
[{ "row_key": "taste", "score": 4 }, { "row_key": "texture", "score": 5 }] |
ranking |
[{ "option_key": "brand-a", "rank": 1 }, { "option_key": "brand-b", "rank": 2 }] |
Short form when sending
Section titled “Short form when sending”When you send responses, a list item can be a bare value in place of an object:
| You send | RedJade reads it as |
|---|---|
["yes"] on a choice question |
[{ "option_key": "yes" }] |
["yes", "other"] on a choice question |
Two selected options |
[62] on a numeric question |
[{ "score": 62 }] |
["I liked it"] on a text question |
[{ "text": "I liked it" }] |
Use the object when a response has more than one field, such as an option with typed text or an answered_at time. RedJade always sends objects.
Not presented and not answered
Section titled “Not presented and not answered”response |
Meaning |
|---|---|
null, or no entry for the question |
The question was not presented to the participant |
[] |
The question was presented and not answered |
[{ "score": 0 }] |
The participant answered zero |
Option scores
Section titled “Option scores”An option’s score is the number that option stands for in analysis. A five-point liking scale is a choice question whose options carry scores 1 to 5. Selecting like-4 records the option; its score comes from the definition.
A response’s own score is a number the participant supplied directly, as on a numeric question. A response score never changes an option’s score.
Send responses without definitions
Section titled “Send responses without definitions”Definitions are optional once RedJade has them. If you send a response to a question RedJade has not seen and include no definition, RedJade creates the question from the response:
| First response | Question created |
|---|---|
[62] |
numeric |
["yes"], a string of letters, digits, and hyphens |
choice, exclusive, with option yes |
["yes", "no"] |
choice, not exclusive |
["I liked it"], any other string |
text |
A question created this way has only the options it has received, and it uses keys as names. A later response with several options makes it non-exclusive. Send a definition when you need the wording, the complete option list, or scores. Once a definition declares a question’s type, the type is fixed.
A question created as choice stays choice. Typed text sent to it later returns 422, and a definition that changes it to text returns 409. A one-word response such as ["yes"] creates a choice question, so define a free-text question as text in its first request.
Change a definition
Section titled “Change a definition”Sending a definition for an existing question updates it. An options list you send replaces the current list. Leaving options out keeps the current list. Text applies to the locale you send and leaves other translations alone.
Responses already collected do not change. A stored response can refer to an option that has since been removed.