Docs home

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&#65533;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&#65533;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_idintegerrequired
Question to update.

Request body: form-data with one field, JSONString, containing this JSON:

BodyJSONString
question_list_idintegerrequired
Question 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.
question_JSONarrayrequired
Common text, as for "Create Question".
input_JSONarrayrequired
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.
Topic tag. Defaults to the bank's topic.
Sub-topic tag. Default 1.
Question custom field values: objects with custom_field_id and field_value.
Media attached to the question. Cleared if left out.
Audio play limit. Default -1 (no limit).
Response200application/json
codeinteger
Example: 200
messagestring
Example: Question deleted !
questionobject
Show child attributesHide child attributes
Example: 12
Example: [" "]
Example: [{"answer":[[2]],"explanation":""}]
Example: true
Example: -1
Example: 1
Example: 139

Notes: 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.

Updated yesterday

Ask AI