Classification classification

Classification (classification)

Allows learners to drag and drop their responses into a multi-column layout using a list of potential answers.

The classification Question is referenced by its type in the code, which is "classification".

Examples

{
    "stimulus": "Classify each planet in our solar system based on its size and its composition.",
    "possible_responses": ["Venus", "Earth", "Neptune", "Mercury", "Jupiter", "Mars", "Uranus", "Saturn"],
    "type": "classification",
    "ui_style": {
        "column_count": 2,
        "column_titles": ["Small Terrestrial", "Large Gas Giant"]
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                [0, 1, 5, 3],
                [2, 4, 6, 7]
            ]
        }
    },
    "instant_feedback": true
}

Attributes

  • type string

    Defines the Question type to be rendered.

    Must be set to "classification" in this case.

  • is_math boolean

    Set to true to have LaTeX or MathML contents to be rendered with mathjax.

    Default: false

  • metadata object

    Object containing additional information about the question.

  • metadata.distractor_rationale string

    Used to display individual response feedback/rationale to the student.

  • metadata.rubric_reference string

    A unique identifier for the rubric to be used with the question - defaults to course rubric if assigned in activity

  • metadata.sample_answer string

    A sample answer to be displayed on the Learnosity Reports API. HTML is supported.

  • metadata.acknowledgements string

    References for any text passages, documents, images etc. used in the question.

  • metadata.distractor_rationale_response_level array

    Used to display individual response feedback/rationale to the student.

  • stimulus string

    The question stimulus. This can include text, tables, images, resources and LaTeX entered via the Math Editor.

  • stimulus_review string

    HTML/Text content displayed only in review state rendered above the drop zone. Supports embedded Feature <span> tags. Will override stimulus in review state.

  • instructor_stimulus string

    HTML/Text content displayed when showInstructorStimulus is set to true on the activity. Supports embedded Feature <span> tags.

  • ui_style object

    Object used to control different aspects of the UI

  • ui_style.fontsize string

    Controls the size of base font for this question. Options are among 'small', 'normal', 'large', 'xlarge' and 'xxlarge'.

    Default: "normal"

  • ui_style.validation_stem_numeration string

    Numeration character to be displayed to the left of the validation label.

    Default: "number"

  • ui_style.possibility_list_position string

    Defines where the list of potential answers is positioned relative to the drop zone.

    Default: "bottom"

    Possible values

    • "top"
    • "bottom"
    • "left"
    • "right"
  • ui_style.column_count number

    Defines the number of columns for the classification table.

    Default: 1

  • ui_style.row_count number

    Defines the number of rows for the classification table.

    Default: 1

  • ui_style.column_titles array[string]

    The titles for the columns in the classification table.

  • ui_style.row_header string

    The heading content for the top left cell position in the classification table.

  • ui_style.row_titles array[string]

    The titles for the rows in the classification table.

  • ui_style.row_min_height string

    The minimum height for the classification table rows, in pixels.

    Default: "60px"

  • ui_style.row_titles_width string

    The column width for the row titles in the classification table, in pixels.

    Default: "60px"

  • ui_style.show_drag_handle boolean

    Controls whether to show the visual indicator showing that the responses are draggable on each possible response.

    Default: true

  • feedback_attempts number

    If instant_feedback is true, this field determines how many times the user can click on the 'Check Answer' button. 0 means unlimited.

    Default: 0

  • instant_feedback boolean

    Flag to determine whether to display a 'Check Answer' button to provide instant feedback to the user.

    Default: false

  • validation object

    In this section, configure the correct answer(s) for the question.

  • validation.allow_negative_scores boolean

    Negative scores will be normalised to zero by default. Allowing negative scores, on the other hand, means that the score can drop below zero when penalties are applied.

    Default: false

  • validation.penalty number

    Value indicating the marks deducted for an incorrect response.

    Default: 0

  • validation.min_score_if_attempted number

    Positive value indicating the minimum score if a student attempted the question.

    Default: 0

  • validation.scoring_type string

    The way in which marks are distributed for the question. Possible options:
    'exactMatch': Exact Match - All parts of the question must be answered correctly to receive a mark.
    'partialMatchV2': Partial Match per Cell - Max Score - Each correct cell will be scored individually, and the overall question score will be divided between cells.
    'partialMatch': Partial Match per Cell - Each correct cell will be awarded an individual score.
    'partialMatchElement': Partial Match per Element - Each correct response element will be awarded an individual score.
    'partialMatchElementV2': Partial Match per Element V2 - Each correct response element will be scored individually, and the overall question score will be divided between responses.

    Default: "exactMatch"

  • validation.unscored boolean

    When enabled, this option will remove all scoring from the question. This is useful for creating practice questions.

    Default: false

  • validation.valid_response object

    An object containing the valid response score and value.

  • validation.valid_response.score number

    Score awarded for the correct response(s).

    Default: 1

  • validation.valid_response.value array[array[number]]

    The indexes of the possible responses selected by the learner, grouped by each cell in the table.

    The response index is based on the index value in the possible_responses attribute.

  • validation.automarkable boolean

    Defines whether the question will be marked automatically, or must be marked manually.

    Default: true

  • validation.alt_responses array

    Add an alternate response if there is more than one correct overall solution to a question.

  • validation.alt_responses[ ].score number

    Score if the alternative response is correct.

    Default: 1

  • validation.alt_responses[ ].value array[array[number]]

    The indexes of the possible responses selected by the learner, grouped by each cell in the table.

    The response index is based on the index value in the possible_responses attribute.

  • group_possible_responses boolean

    Categorize possible responses into different groups, with each group having its own heading.

    Default: false

  • description string

    Deprecated See stimulus_review.
    Description of the question and its context to be displayed. It supports HTML entities.

  • shuffle_options boolean

    Use this to shuffle classification possible responses order.

    Default: false

  • duplicate_responses boolean

    When true the items from the possible_responses will be reusable infinite times.

    Default: false

  • max_response_per_cell number

    The maximum number of possible responses each cell can have.

    If not specified or set to 0, there is no limit.

    Default: 0

Response format

The data returned in the response format for this Question is an array of arrays, each containing indexes, which are the responses that the learner dragged into the drop zones in the table.

Response format examples

{
    "value": [
        [ 1, 2, 4 ],
        [ 0 ],
        null,
        [ 5 ]
    ],
    "type": "array",
    "apiVersion": "v2.222.0",
    "revision": 1
}

Response attributes

  • value array[array[number]]

    The indexes of the possible responses selected by the learner, grouped by each cell in the table.

    The response index is based on the index value in the possible_responses attribute.

  • type string

    Informs the scoring engine about what kind of data to expect in the values entered by the student. For this Question type, you must always supply a string for this attribute with the value "array".

  • apiVersion string

    The version of the Questions API that returned this reponse.

  • revision numeric

    Keeps track of the number of Question attempt submissions, i.e. how many times the student answered the Question and submitted it.

  • feedbackAttemptsCount numeric

    Keeps track of the number of feedback attempts.

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.