Chart simplechart

Chart (simplechart)

The chart Question is referenced by its Question type in the code, which is simplechart. The chart Question allows students to create or modify charts, including bar charts, line charts, histograms, dot plots and line plots.

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: "simplechart"

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

    Default: "bar"

  • ui_style.point_style string

    Default: "dot"

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

    • Exact Match - All parts of the question must be answered correctly to receive a mark.
    • Partial Match Per Response - Each correct response element will be awarded an individual score.
    • Partial Match - 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

    An array containing the valid responses for each point in the template in corresponding order.

    Default: []

  • validation.valid_response.value[ ].x string

  • validation.valid_response.value[ ].y number

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

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

  • validation.automarkable boolean

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

    Default: true

  • validation.threshold number

    Positive value indicating the correct value threshold.

    Default: 0

  • validation.ignore_order boolean

    Boolean value indicating whether the points order should be ignored or not.

    Default: true

  • max_y_value number

    Defines the max value of the Y axis.

  • chart_data object

    Object containing chart data and its series name.

  • chart_data.name string

    The title of the chart.

    Default: "Series title"

  • chart_data.data array

    Default: []

  • chart_data.data[ ].x string

    Point label

  • chart_data.data[ ].y number

    Point value

    Default: 0

  • chart_data.data[ ].interactive boolean

    Interactive point

    Default: true

  • chart_data.data[ ][ ].x string

    Point label

  • chart_data.data[ ][ ].y number

    Point value

    Default: 0

  • chart_data.data[ ][ ].interactive boolean

    Interactive point

    Default: true

  • add_point boolean

    Enabled the ability to add points to the chart.

    Default: false

  • resize_point boolean

    Enable the ability to resize points in the chart.

    Default: true

  • edit_label boolean

    Enables the ability to edit point labels

    Default: false

  • delete_point boolean

    Enables the ability to delete points

    Default: false

  • x_axis_label string

    Set the x axis label name

  • y_axis_label string

    Set the Y axis label name

  • snap_to_grid string/number

    Specify snap to grid threshold. Snap to grid is disabled if set to 0 or if the tick format is float.

    Default: true

  • stacked_fraction boolean

    If checked, x-axis labels with numeric linear (slashed) fractions will be displayed as a stacked fraction with a vinculum (horizontal bar). Non numeric text will be stripped from the label.

    Default: false

  • multicolour boolean

    Enables the ability to specify if the bars have different colors. Currently only supported by histogram. Order Point has to be disabled.

    Default: true

  • order_point boolean

    Enables ability to order points

  • show_gridlines string

    Specify whether axes gridlines should be displayed for the chart. Currently only supported by histogram.

  • new_point_name string

    Enables the ability to specify new points default name.

Response format

The data returned in the response format for this Question is the information for the chart data, which are the data points that the student added to the chart or moved on the chart display.

Note: the different types of chart will return different data formats.

Response format examples

{
                "value": {
                    "data": [
                        {
                            "x": "A",
                            "y": 10
                        },
                        {
                            "x": "B",
                            "y": 20
                        },
                        {
                            "x": "C",
                            "y": 40,
                            "interactive": true
                        },
                        {
                            "x": "D",
                            "y": 40
                        },
                        {
                            "x": "E",
                            "y": 50
                        },
                        {
                            "x": "F",
                            "y": 60
                        },
                        {
                            "x": "G",
                            "y": 70
                        },
                        {
                            "x": "H",
                            "y": 80
                        }
                    ],
                    "name": "Bar chart"
                },
                "type": "object",
                "apiVersion": "v2.173.0",
                "revision": 1,
                "feedbackAttemptsCount": 1
            }
            {
                "value": {
                    "data": [
                        {
                            "x": "A",
                            "y": 10
                        },
                        {
                            "x": "B",
                            "y": 15
                        },
                        {
                            "x": "C",
                            "y": 30
                        }
                    ],
                    "name": "Line chart"
                },
                "type": "object",
                "apiVersion": "v2.173.0",
                "revision": 1,
                "feedbackAttemptsCount": 1
            }

Response attributes

  • value object

    The information in the chart entered or changed by students.

  • value.data object

    The data points within the chart.

  • value.name string

    The type of chart being displayed. This will be one of the following: "Bar chart", "Line chart", "Histogram", "Dot plot", or "Line plot".

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

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