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},
        "properties": {
            "text_similarity": {TextSimilarity},
            "text_similarity_answer": "{TextSimilarityAnswer}"
        }
    },
    "answers": [
        {
            "old_id": "{OldId}",
            "answer": "{Answer}",
            "is_correct": {IsCorrect}
        },
        ...
    ],
    "resources": {
        "{ResourcePath}": "{ResourceCnt}",
        ...
    }
}

Response parameters

{
    "question": {
        "id": {QuestionId},
        "test_id": {TestId},
        "question": "{Question}",
        "explanation": "{Explanation}",
        "type": {Type},
        "case_study_id": {CaseStudyId},
        "properties": {
            "text_similarity": {TextSimilarity},
            "text_similarity_answer": "{TextSimilarityAnswer}"
        }
    },
    "answers": [
        {
            "id": {AnswerId},
            "old_id": "{OldId}",
            "answer": "{Answer}",
            "is_correct": {IsCorrect}
        },
        ...
    ],
    "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.
  • 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.
properties Object Optional Properties of the question. Each question type has its own valid properties.
{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.
answers Array Optional Array of answer options. Mandatory for single and multiple choice questions.
{AnswerId} Integer Mandatory Answer id. Available only in response. No need to provide it in request as 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.
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.