Delete Question
Updates a question, or deletes it when you send `is_removed: true`. Send the whole question each time, as for creating one: fields you leave out are reset.
POST
/questions/{question_id}Delete Question
curl --request POST \
--url 'https://<your-api-host>/nuSource/api/v1/questions/{question_id}' \
--header 'APIKEY: <your-api-key>' \
--header 'ORGID: <your-org-id>' \
--form 'JSONString={"question_list_id":12,"question_JSON":[" "],"input_JSON":[{"input_type":0,"question_string":"<p>The main source of India�s National Income was</p>\n","options":[{"index":0,"option_string":"<p>Forestry</p>\n"},{"index":1,"option_string":"<p>Industry</p>\n"},{"index":2,"option_string":"<p>Agriculture</p>\n","is_correct":1},{"index":3,"option_string":"<p>None of the above</p>\n"}],"marks":"1.00","neg_mark":-0.25,"hint":"","explanation":""}],"answer_JSON":"[{\"answer\":[[2]],\"explanation\":\"\"}]","is_removed":true,"sound_asset":null,"sound_play_times":-1,"difficulty":1}'{
"code": 200,
"message": "Question deleted !",
"question": {
"question_list_id": 12,
"question_JSON": "[\" \"]",
"input_JSON": "[{\"input_type\":0,\"question_string\":\"<p>The main source of India�s National Income was<\\/p>\\n\",\"options\":[{\"index\":0,\"option_string\":\"<p>Forestry<\\/p>\\n\"},{\"index\":1,\"option_string\":\"<p>Industry<\\/p>\\n\"},{\"index\":2,\"option_string\":\"<p>Agriculture<\\/p>\\n\",\"is_correct\":1},{\"index\":3,\"option_string\":\"<p>None of the above<\\/p>\\n\"}],\"marks\":\"1.00\",\"neg_mark\":-0.25,\"hint\":\"\",\"explanation\":\"\"}]",
"answer_JSON": "[{\"answer\":[[2]],\"explanation\":\"\"}]",
"is_removed": true,
"sound_asset": null,
"sound_play_times": -1,
"difficulty": 1,
"engage_sub_topic_tag_id": 1,
"question_id": 139
}
}Access: Institute admins, admins and tutors, plus custom roles with question bank or curriculum manage permission.
Path parameters
Question to update.
Request body: form-data with one field, JSONString, containing this JSON:
Body
JSONStringQuestion bank the question belongs to. Must be a bank you created or one shared with your organization. Sending a different bank moves the question there.
Common text, as for "Create Question".
The question inputs, same fields and rules as "Create Question".
is_removedboolean
true deletes the question. Default false.difficultyinteger
1 Easy, 2 Medium, 3 Hard. Defaults to the bank's difficulty.engage_topic_tag_idinteger
Topic tag. Defaults to the bank's topic.
engage_sub_topic_tag_idinteger
Sub-topic tag. Default
1.custom_fieldsarray
Question custom field values: objects with
custom_field_id and field_value.Media attached to the question. Cleared if left out.
sound_play_timesinteger
Audio play limit. Default
-1 (no limit).Response
codeinteger
Example:
200messagestring
Example:
Question deleted !questionobject
Show child attributesHide child attributes
question.question_list_idinteger
Example:
12question.question_JSONstring
Example:
[" "]question.input_JSONstring
question.answer_JSONstring
Example:
[{"answer":[[2]],"explanation":""}]question.is_removedboolean
Example:
truequestion.sound_play_timesinteger
Example:
-1question.difficultyinteger
Example:
1Example:
1question.question_idinteger
Example:
139Notes: The question text and options are validated as on create, even when deleting. A deleted question is also taken out of any test that picked it individually. Error "You dont have permission to update this question!" (or "delete") when the bank is not yours. Rate limit: 30 requests per minute; going over locks you out for 30 minutes.