Number line plot numberlineplot

Number line plot (numberlineplot)

The number line plot Question is referenced by its Question type in the code, which is numberlineplot. This Question allows students to plot points on a line, or stack points above a line.

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.

  • metadata.distractor_rationale_response_level array

    Used for storing the distractor rationales that map to responses in the same order for use/rendering by the host environment.

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

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

    Allows author to decide between horizontal and vertical plotting.

    Default: "horizontal"

  • ui_style.spacing stringUnits

    Spacing between stacked responses with trailing px unit eg. "30px"

    Default: "30px"

  • ui_style.number_line_margin string

    Distance from the number line's extremes to the sides with trailing px unit eg. "5px"

    Default: "5px"

  • ui_style.width stringUnits

    Width of the drawn area with trailing px unit eg. "550px".

    Default: "550px"

  • ui_style.height stringUnits

    Height of the drawn area with trailing px unit eg. "500px".

    Default: "500px"

  • ui_style.min_width stringUnits

    Minimum width of the drawn area with trailing px unit eg. "550px". Width in vertical mode is being calculated automatically, but you can force width to take at least some amount of space. Note also that toolbox takes 55px.

    Default: "550px"

  • 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 response element will be scored individually, and the overall question score will be divided between responses.
    'partialMatch': Partial Match per Response - Each correct response element will be awarded an individual score.

    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

    An array containing objects defining the correct response for a given tool, e.g. response: { type: 'segment', point1: { x: 0, y: 0 }, point2: { x: 0, y: 0 } }

  • validation.valid_response.value[ ].type string

    Type of the tool

  • validation.valid_response.value[ ].point1 string

    Position of the first point (from left)

  • validation.valid_response.value[ ].point2 string

    Position of the second point if necessary (from left)

  • validation.valid_response.value[ ][ ].type string

    Type of the tool

  • validation.valid_response.value[ ][ ].point1 string

    Position of the first point (from left)

  • validation.valid_response.value[ ][ ].point2 string

    Position of the second point if necessary (from left)

  • 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

    An array containing objects defining the correct response for a given tool, e.g. response: { type: 'segment', point1: { x: 0, y: 0 }, point2: { x: 0, y: 0 } }

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

    Type of the tool

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

    Position of the first point (from left)

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

    Position of the second point if necessary (from left)

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

    Type of the tool

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

    Position of the first point (from left)

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

    Position of the second point if necessary (from left)

  • validation.alt_responses[ ][ ].score number

    Score if the alternative response is correct.

    Default: 1

  • validation.alt_responses[ ][ ].value array

    An array containing objects defining the correct response for a given tool, e.g. response: { type: 'segment', point1: { x: 0, y: 0 }, point2: { x: 0, y: 0 } }

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

    Type of the tool

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

    Position of the first point (from left)

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

    Position of the second point if necessary (from left)

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

    Type of the tool

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

    Position of the first point (from left)

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

    Position of the second point if necessary (from left)

  • title string

    Response area title

  • line object

  • line.min number

    Minimum value for the number line

    Default: -10

  • line.left_arrow boolean

    Draw an arrow on the left hand side of the line

    Default: false

  • line.max number

    Maximum value for the number line

    Default: 10

  • line.right_arrow boolean

    Draw an arrow on the right hand side of the line

    Default: false

  • ticks object

  • ticks.distance string/number

    The distance between ticks on the number line

    Default: 1

  • ticks.minor_ticks number

    Number of minor ticks between major ticks

    Default: 3

  • ticks.base string

    Value on the line, where rendering of ticks should start

    Default: "min-value-based"

  • ticks.show boolean

    Whether to draw ticks on the line or not

    Default: false

  • ticks.show_min boolean

    Whether to draw min tick on the line or not

    Default: false

  • ticks.show_max boolean

    Whether to draw max tick on the line or not

    Default: false

  • labels object

  • labels.show boolean

    Whether to show labels on the line or not (only when tick is shown)

    Default: true

  • labels.show_min boolean

    Whether to show min label on the line or not (only when tick is shown)

    Default: true

  • labels.show_max boolean

    Whether to show max label on the line or not (only when tick is shown)

    Default: true

  • stacked boolean

    Whether responses should be stacked, or plotted on the line

    Default: true

  • stacked_elements number

    Number of elements/responses user can add to the number line

    Default: 1

  • toolbar array

    Allows you to choose toolbar buttons. By default all are available

  • points string

    Specific point at which labels need to be drawn. Separate values by commas, eg: -2.5, 2.5

Response format

The data returned in the response format for this Question is the points that the student plotted on a line, or points that were stacked above a line.

Response format examples

{
    "value": [
        {
            "type": "point",
            "point1": -6
        }
    ],
    "type": "array",
    "apiVersion": "v2.173.0",
    "revision": 1,
    "feedbackAttemptsCount": 1
}

Response attributes

  • value array

    The the points that the student plotted on a line, or points that were stacked above a line.

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