Create/Update question

Method Description
exam.questionCreate Create question.
exam.questionUpdate Update question.

Request parameters

{
    "question": {
        "id": {QuestionId}, /* Only for update operation */
        "test_id": {TestId},
        "question": "{Question}",
        "explanation": "{Explanation}",
        "type": {Type},
        "case_study_id": {CaseStudyId},
        "external_id": "{ExternalId}",
        "properties": {
            "text_similarity": {TextSimilarity},
            "text_similarity_answer": "{TextSimilarityAnswer}",
            "optional_answers": "{OptionalAnswers}"
        }
    },
    "answers": [
        {
            "old_id": "{OldId}",
            "answer": "{Answer}",
            "is_correct": {IsCorrect},
            "order": {Order}
        },
        ...
    ],
    "resources": {
        "{ResourcePath}": "{ResourceCnt}",
        ...
    }
}

Response parameters

{
    "question": {
        "id": {QuestionId},
        "test_id": {TestId},
        "question": "{Question}",
        "explanation": "{Explanation}",
        "type": {Type},
        "case_study_id": {CaseStudyId},
        "external_id": "{ExternalId}",
        "properties": {
            "text_similarity": {TextSimilarity},
            "text_similarity_answer": "{TextSimilarityAnswer}",
            "optional_answers": "{OptionalAnswers}"
        }
    },
    "answers": [
        {
            "id": {AnswerId},
            "old_id": "{OldId}",
            "answer": "{Answer}",
            "is_correct": {IsCorrect},
            "order": {Order}
        },
        ...
    ],
    "resources": {
        "{ResourcePath}": "{NewResourcePath}",
        ...
    },
    "completed": {Comleted}
}

Variable Type Appearance Description
{QuestionId} Integer Mandatory Question id. Mandatory for update operation.
{TestId} Integer Mandatory Exam id.
{Question} String Mandatory Question content. HTML formatted, may contain media resources like images and audio. Please be aware that only relative URLs are allowed.
{Explanation} String Optional Explanation content. HTML formatted, may contain media resources like images and audio. Please be aware that only relative URLs are allowed.
{Type} Integer Mandatory Type of the question. Following options are available:
  • 1 - Single choice question. Selection of one answer represents correct question answer.
  • 2 - Multiple choice question. Selection of several answers represents correct question answer.
  • 6 - Sort / Reorder question. Answer variants needs to be presented in the correct order.
  • 7 - Text similarity question. The answer have to be typed manually and then will be compared with the reference.
{CaseStudyId} Integer Optional Case study id. Reference to case study id. Question will be displayed together with referenced case study.
{ExternalId} String Optional External Id. Optional field to store external system question id, which later can be used for matching/synchronization.
properties Object Optional Properties of the question. Each question type has its own valid properties.
{TextSimilarity} Integer Mandatory Valid for Text similarity questions. Text similarity percentage. Acceptable value range is 0-100. 90 is recommended value for exact match, when examinee is expected to type exact same answer. Mandatory for all text similarity question.
{TextSimilarityAnswer} String Mandatory Valid for Text similarity questions. Correct answer for the question. Mandatory for all text similarity question. Does not support HTML formatting.
{OptionalAnswers} Boolean Optional Valid for Sort / Reorder questions. Indicates that answer variants are optional and the user should reorder answer variants into correct order and indicate which answer variants are part of the correct answer.
answers Array Optional Array of answer options. Mandatory for single and multiple choice questions.
{AnswerId} Integer Mandatory Answer id. Optional in request. No need to provide it in request, all answer options will be re-created.
{OldId} Integer Optional Your answer id. State it if you want to get association of your answer id with newly created answer id.
{Answer} String Mandatory Answer content. HTML formatted, may contain media resources like images and audio. Please be aware that only relative URLs are allowed. At least two answers are expected.
{IsCorrect} Boolean Optional Possible values true/false. Indicates whether the answer option is correct or no.
  • Single choice question: only one answer option can be marked as correct.
  • Multiple choice question: more than one correct answer is expected.
{Order} Integer Mandatory Valid and mandatory for Sort / Reorder question type. Indicates the correct sequence order of the answer option.
resources Object Optional If you are using media resources like images you need to send the content of each media resource under "resources" node.
{ResourcePath} String Mandatory Path of media resource. Same value as it was used in Description.
Example: "image.jpg" for <img src="image.jpg">.
{ResourceCnt} String Mandatory Base64 encoded content of media resource.
{NewResourcePath} String Mandatory New media resource path.
{Completed} Boolean Mandatory Indicates whether action was successfully completed or not.