Create multiple questions

Method Description
exam.questionCreateBatch Create multiple questions in one call.

Creates up to 50 questions in a single call, all in the same exam - every entry's {ExamId} must be identical, or the whole call is rejected before anything is created. Each entry in questions is shaped exactly like a single exam.questionCreate request - see that page for the full description of the question/answers/resources fields (including the per-type properties shapes), which are identical here.

Partial success: every entry is validated and saved independently - one invalid question does not block the others. The response lists a per-entry result in the same order (and of the same length) as the request's questions array.

Request parameters

{
    "questions": [
        {
            "question": {
                "exam_id": {ExamId},
                "question": "{Question}",
                "explanation": "{Explanation}",
                "type": {Type},
                "case_study_id": {CaseStudyId},
                "external_id": "{ExternalId}",
                "points": {QuestionPoints},
                "properties": {QuestionProperties}
            },
            "answers": [
                {
                    "old_id": "{OldId}",
                    "answer": "{Answer}",
                    "is_correct": {IsCorrect},
                    "order": {Order},
                    "points": {AnswerPoints}
                },
                ...
            ],
            "resources": {
                "{ResourcePath}": "{ResourceCnt}",
                ...
            }
        },
        ...
    ]
}

Response parameters

{
    "results": [
        // example entry for a question that was created successfully
        {
            "index": {ResultIndex},
            "completed": true,
            "question": { ... same shape as exam.questionCreate's "question" response ... },
            "answers": [ ... ],
            "resources": { ... }
        },
        // example entry for a question that failed validation and was not created
        {
            "index": {ResultIndex},
            "completed": false,
            "error": "{ResultError}"
        }
        // ... one entry per submitted question, in the same order as the request's "questions" array ...
    ],
    "created_count": {CreatedCount},
    "failed_count": {FailedCount}
}

Parameters meaning

Variable Type Appearance Description
questions Array Mandatory One entry per question to create. Must be non-empty and contain no more than 50 entries, or the whole call is rejected before any question is created.
question, answers, resources Object / Array Mandatory Identical in shape and meaning to the question/answers/resources nodes of exam.questionCreate's request - see that page for the full field list, per-type properties shapes (image-based, sort/reorder, text-input questions), and the answers requirements (mandatory and non-empty for single/multiple choice and sort/reorder questions).
response
results Array Mandatory One entry per requested question, in the same order as the request's questions array.
{ResultIndex} Integer Mandatory 0-based position of this entry within the request's questions array.
{Completed} Boolean Mandatory Whether this specific question was created - same field, same meaning, as a single exam.questionCreate call's own {Completed}. When true, the rest of the entry is the same question/answers/resources shape a single exam.questionCreate call returns. When false, only {ResultError} is present.
{ResultError} String Optional Present only when {Completed} is false. The validation error(s) for this specific entry - the same message exam.questionCreate itself would have returned for this entry alone.
{CreatedCount} Integer Mandatory Number of entries successfully created.
{FailedCount} Integer Mandatory Number of entries that failed validation and were not created.