Shading simpleshading

Shading (simpleshading)

The shading Question is referenced by its Question type in the code, which is simpleshading. This Question allows students to click on square "cells", which become shaded when clicked as their response. This Question is used to show a visual representation of functions and calculations, including fractions and ratios. Authors are able to format a set of cells, which are shaded by the student.

Attributes

  • 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.

  • 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 response area. 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.

  • type string

    Type of question being asked, e.g. 'association'

    Default: "simpleshading"

  • 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"

  • 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 - Each correct cell will be scored individually, and the overall question score will be divided between the amount of correct cells.

    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 object

    An object containing the state of valid responses for each locations.

  • validation.valid_response.value.method string

    Score the response based on exact locations.

    Default: "byLocation"

  • validation.valid_response.value.value number

    The value will be different types according to the method:
    'byLocation': value should be an array of form [y, x] that use 1-based indexing rather than 0-based, e.g. [1, 1] means the cell at first row, first column.
    'byCount': value should be a number.

  • 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 object

    An object containing the state of valid responses for each locations.

  • validation.alt_responses[ ].value.method string

    Score the response based on exact locations.

    Default: "byLocation"

  • validation.alt_responses[ ].value.value number

  • validation.alt_responses[ ][ ].score number

    Score if the alternative response is correct.

    Default: 1

  • validation.alt_responses[ ][ ].value object

    An object containing the state of valid responses for each locations.

  • validation.alt_responses[ ][ ].value.method string

    Score the response based on exact locations.

    Default: "byLocation"

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

  • max_selection number

    How many elements can user select? If set to 0, user can select unlimited elements.

  • border string

    Defines how border displays.

    Default: "full"

  • hover boolean

    Defines whether to have hover state effect.

    Default: true

  • canvas object

    Object containing canvas options and configurations.

  • canvas.row_count number

    Number of rows

    Default: 3

  • canvas.column_count number

    Number of columns

    Default: 3

  • canvas.cell_height number

    Cell height ratio, eg 1.0 - 40px, 1.5 - 60px.

    Default: 1

  • canvas.cell_width number

    Cell width ratio, eg 1.0 - 40px, 1.5 - 60px.

    Default: 1

  • canvas.shaded array

    Coordinates of the author-shaded canvas. Authors can define certain canvas elements to be pre-shaded before the assessment begins. The value is an array of arrays that contain the coordinate row and column groups, i.e. [ [row1, column1], [row2, column2], ... ]. Note the position is an array of form [y, x] that uses 1-based indexing rather than 0-based, e.g. [1, 3] means the cell at first row, third column.

    Default: []

  • canvas.read_only_author_cells boolean

    Prevents user from modifying Author Shaded

    Default: false

  • canvas.hidden array

    Coordinates of the author-hidden canvas. Authors can hide certain canvas elements before the assessment begins. The value is an array of arrays that contain the coordinate row and column groups, i.e. [ [row1, column1], [row2, column2], ... ]. Note the position is an array of form [y, x] that uses 1-based indexing rather than 0-based, e.g. [1, 3] means the cell at first row, third column.

    Default: []

  • canvas.img_src string

    Shade with image

  • canvas.alt textarea

    The alternative text of the shading image.

    Default: ""

  • canvas.title string

    The title of the shading image

  • canvas_container_style canvasContainerStyle

    Object containing style options for the canvas container.

  • background_image object

  • background_image.src string

  • background_image.width number

    Image width in percentage of the canvas width

    Default: 100

  • background_image.height number

    Image height in percentage of the canvas height

    Default: 100

  • background_image.opacity number

    Percentage value defining how opaque the image is

    Default: 100

  • background_image.alt textarea

    The alternative text of the background image.

    Default: ""

  • background_image.title string

    The title of the background image

Response format

The data returned in the response format for this Question is the square "cells", which become shaded when clicked by the student as their response.

Response format examples

{
    "value": [
        [
            1,
            1
        ],
        [
            2,
            2
        ],
        [
            3,
            3
        ]
    ],
    "type": "array",
    "apiVersion": "v2.173.0",
    "revision": 1,
    "feedbackAttemptsCount": 1
}

Response attributes

  • value array

    The data about the square "cells", which become shaded when clicked by the student as their response.

  • 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 response.

  • 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.