doc/examples/quiz_question_answers.md
essay_questionText{ "answer": "Answer text." }Example request
{
"answer": "<h2>My essay</h2>\n\n<p>This is a long article.</p>"
}
Possible errors
<table> <thead> <tr> <th>HTTP RC</th> <th>Error Message</th> <th>Cause</th> </tr> </thead> <tbody> <tr> <td>400 Bad Request</td> <td><code>Text is too long.</code></td> <td>The answer text is larger than the allowed limit of 16 kilobytes.</td> </tr> </tbody> </table>fill_in_multiple_blanks_questionHash{String => String}{ "answer": { "variable": "Answer string." } }Example request
Given that the question accepts answers to two variables, color1 and color2:
{
"answer": {
"color1": "red",
"color2": "green"
}
}
Possible errors
<table> <thead> <tr> <th>HTTP RC</th> <th>Error Message</th> <th>Cause</th> </tr> </thead> <tbody> <tr> <td>400 Bad Request</td> <td><code>Unknown variable 'var'.</code></td> <td>The answer map contains a variable that is not accepted by the question.</td> </tr> <tr> <td>400 Bad Request</td> <td><code>Text is too long.</code></td> <td>The answer text is larger than the allowed limit of 16 kilobytes.</td> </tr> </tbody> </table>short_answer_questionString{ "answer": "Some sentence." }Example request
{
"answer": "Hello World!"
}
Possible errors
Similar to the errors produced by Essay Questions.
<a class="bookmark" id="formula-questions"></a>
calculated_questionDecimal{ "answer": decimal } where decimal is either a rational
number, or a literal version of it (String)Example request
With an exponent:
{
"answer": 2.3e-6
}
With a string for a number:
{
"answer": "13.4"
}
Possible errors
<table> <thead> <tr> <th>HTTP RC</th> <th>Error Message</th> <th>Cause</th> </tr> </thead> <tbody> <tr> <td>400 Bad Request</td> <td><code>Parameter must be a valid decimal.</code></td> <td>The specified value could not be processed as a decimal.</td> </tr> </tbody> </table>matching_questionArray<Hash>{ "answer": [{ "answer_id": id, "match_id": id }] } where
the IDs must identify answers and matches accepted by the question.Example request
Given that the question accepts 3 answers with IDs [ 3, 6, 9 ] and 6 matches
with IDs: [ 10, 11, 12, 13, 14, 15 ]:
{
"answer": [{
"answer_id": 6,
"match_id": 10
}, {
"answer_id": 3,
"match_id": 14
}]
}
The above request:
answer#6 with match#10answer#3 with match#14answer#9 un-matchedPossible errors
<table> <thead> <tr> <th>HTTP RC</th> <th>Error Message</th> <th>Cause</th> </tr> </thead> <tbody> <tr> <td>400 Bad Request</td> <td><code>Answer must be of type Array.</code></td> <td>The match-pairings set you supplied is not an array.</td> </tr><tr>
<td>400 Bad Request</td>
<td><code>Answer entry must be of type Hash, got '...'.</code></td>
<td>One of the entries of the match-pairings set is not a valid hash.</td>
</tr>
<tr>
<td>400 Bad Request</td>
<td><code>Missing parameter 'answer_id'.</code></td>
<td>One of the entries of the match-pairings does not specify an <code>answer_id</code>.</td>
</tr>
<tr>
<td>400 Bad Request</td>
<td><code>Missing parameter 'match_id'.</code></td>
<td>One of the entries of the match-pairings does not specify an <code>match_id</code>.</td>
</tr>
<tr>
<td>400 Bad Request</td>
<td><code>Parameter must be of type Integer.</code></td>
<td>
One of the specified <code>answer_id</code> or <code>match_id</code>
is not an integer.
</td>
</tr>
<tr>
<td>400 Bad Request</td>
<td><code>Unknown answer '123'.</code></td>
<td>An <code>answer_id</code> you supplied does not identify a valid answer
for that question.</td>
</tr>
<tr>
<td>400 Bad Request</td>
<td><code>Unknown match '123'.</code></td>
<td>A <code>match_id</code> you supplied does not identify a valid match
for that question.</td>
</tr>
<a class="bookmark" id="multiple-choice-questions"></a>
multiple_choice_questionInteger{ "answer": answer_id } where answer_id is an ID of
one of the question's answers.Example request
Given an answer with an ID of 5:
{
"answer": 5
}
Possible errors
<table> <thead> <tr> <th>HTTP RC</th> <th>Error Message</th> <th>Cause</th> </tr> </thead> <tbody> <tr> <td>400 Bad Request</td> <td><code>Parameter must be of type Integer.</code></td> <td>The specified `answer_id` is not an integer.</td> </tr> <tr> <td>400 Bad Request</td> <td><code>Unknown answer '123'</code></td> <td>The specified `answer_id` is not a valid answer.</td> </tr> </tbody> </table>multiple_dropdowns_questionHash{String => Integer}{ "answer": { "variable": answer_id } } where the keys
are variables accepted by the question, and their values are IDs of answers
provided by the question.Example request
Given that the question accepts 3 answers to a variable named color with the
ids [ 3, 6, 9 ]:
{
"answer": {
"color": 6
}
}
Possible errors
<table> <thead> <tr> <th>HTTP RC</th> <th>Error Message</th> <th>Cause</th> </tr> </thead> <tbody> <tr> <td>400 Bad Request</td> <td><code>Unknown variable 'var'.</code></td> <td>The answer map you supplied contains a variable that is not accepted by the question.</td> </tr> <tr> <td>400 Bad Request</td> <td><code>Unknown answer '123'.</code></td> <td>An <code>answer_id</code> you supplied does not identify a valid answer for that question.</td> </tr> </tbody> </table>multiple_answers_questionArray<Integer>{ "answer": [ answer_id ] } where the array items are
IDs of answers accepted by the question.Example request
Given that the question accepts 3 answers with the ids [ 3, 6, 9 ] and we
want to select the answers 3 and 6:
{
"answer": [ 3, 6 ]
}
Possible errors
<table> <thead> <tr> <th>HTTP RC</th> <th>Error Message</th> <th>Cause</th> </tr> </thead> <tbody> <tr> <td>400 Bad Request</td> <td><code>Selection must be of type Array.</code></td> <td>The selection set you supplied is not an array.</td> </tr> <tr> <td>400 Bad Request</td> <td><code>Parameter must be of type Integer.</code></td> <td>One of the answer IDs you supplied is not a valid ID.</td> </tr><tr>
<td>400 Bad Request</td>
<td><code>Unknown answer '123'.</code></td>
<td>An answer ID you supplied in the selection set does not identify a
valid answer for that question.</td>
</tr>
numerical_questionThis is similar to Formula Questions.
<a class="bookmark" id="essay-questions"></a>
true_false_questionThe rest is similar to Multiple Choice questions.