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": {QuestionProperties}
    },
    "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": {QuestionProperties}
    },
    "answers": [
        {
            "id": {AnswerId},
            "old_id": "{OldId}",
            "answer": "{Answer}",
            "is_correct": {IsCorrect},
            "order": {Order}
        },
        ...
    ],
    "resources": {
        "{ResourcePath}": "{NewResourcePath}",
        ...
    },
    "completed": {Comleted}
}

Parameters meaning

Variable Type Appearance Description
question
{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.
  • 3 - Drag & Drop question (image-based). The correct answer is defined by dragging each draggable block onto its matching target block.
  • 4 - Point & Shoot question (image-based). The correct answer is set by placing one or more markers in the correct position.
  • 5 - Hot Area (image-based). The correct answer is set by selecting one or more hot areas.
  • 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.
{QuestionProperties} Object Optional Properties of the question. Valid properties vary by question type. Refer to the definitions below.
answers
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
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.
response
{Completed} Boolean Mandatory Indicates whether action was successfully completed or not.

Question properties for image-based questions

This section describes the properties for the following question types:
  • 3 - Drag & Drop question.
  • 4 - Point & Shoot question.
  • 5 - Hot Area.
{
    "image": {ResourcePath},
    "areas": [
        {
            "id": {AreaId},
            "x": {AreaXPos},
            "y": {AreaYPos},
            "width": {AreaWidth},
            "height": {AreaHeight},
            "type": {AreaType}
        },
        ...
    ],
    "options": {
        "FixedWidth": {FixedWidth},
        "FixedHeight": {FixedHeight},
        "OneToOneMatching": {OneToOneMatching},
        "SingleAnswer": {SingleAnswer}
    },
    "match": {
        "{TargetAreaId}": {DraggableAreaId},
        ...
    },
    "correct": {
        "{AreaId}": {IsCorrectArea},
        ...
    }
}
Property Type Appearance Description
image
{ResourcePath} String Mandatory The base image path. The image content must be provided in the resources node of the request.
areas
{AreaId} String Mandatory Identifies the area ID. Area IDs must comply with the following templates, depending on the question type:
  • drag-N, targ-N for Drag & Drop questions.
  • block-N for Point & Shoot and Hot Area questions.
Where N is the sequential number of the area.
{AreaXPos} Integer Mandatory Specifies the horizontal position of the area (X-axis).
{AreaYPos} Integer Mandatory Specifies the vertical position of the area (Y-axis).
{AreaWidth} Integer Mandatory Specifies the width of the area.
{AreaHeight} Integer Mandatory Specifies the height of the area.
{AreaType} Integer Mandatory Applicable only to Drag & Drop questions. Specifies the type of the area:
  • 1 - Target area.
  • 2 - Draggable area.
options
{FixedHeight} Boolean Mandatory Specifies whether all areas must have the same height.
{FixedWidth} Boolean Mandatory Specifies whether all areas must have the same width.
{OneToOneMatching} Boolean Mandatory Applicable only to Drag & Drop questions. Ensures that each draggable block can be matched with only one target block.
{SingleAnswer} Boolean Mandatory Applicable only to Point & Shoot and Hot Area questions. Ensures that only one block is marked as correct.
match
{TargetAreaId} String Mandatory Applicable only to Drag & Drop questions. Refers to the area ID of a target type and indicates that the specified target is matched with a specific draggable block.
{DraggableAreaId} String Mandatory Applicable only to Drag & Drop questions. Refers to the area ID of a draggable type and indicates that the specified target is matched with a specific draggable block.
correct
{IsCorrectArea} Boolean Mandatory Applicable only to Point & Shoot and Hot Area questions. Indicates whether the specified block is part of the correct answer.

Sort / Reorder questions properties

{
    "optional_answers": {OptionalAnswers}
}
Property Type Appearance Description
{OptionalAnswers} Boolean Optional Indicates that answer variants are optional, the user should reorder answer variants into correct order and indicate which answer variants are part of the correct answer.

Text similarity questions properties

{
    "text_similarity": {TextSimilarity},
    "text_similarity_answer": "{TextSimilarityAnswer}",
}
Property Type Appearance Description
{TextSimilarity} Integer Mandatory 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 Correct answer for the question. Mandatory for all text similarity question. Does not support HTML formatting.