Graph plotting (graphplotting)
The graph plotting Question is referenced by its Question type in the code, which is graphplotting
. This Question allows students to to plot points, lines, and shapes on a coordinate grid.
- Read the authoring documentation for a description of what this Question does.
- Read the developer reference documentation to see configuration options for this Question type.
Examples
{
"axis": {
"draw_labels": true,
"ticks_distance": 1
},
"canvas": {
"snap_to": "grid",
"x_max": 8,
"x_min": -8,
"y_max": 8,
"y_min": -8
},
"grid": {
"x_distance": 1,
"y_distance": 1
},
"instant_feedback": true,
"response_id": "60021",
"type": "graphplotting",
"ui_style": {
"height": "400px",
"width": "400px"
},
"validation": {
"penalty_score": "0",
"valid_response": [
[{
"id": "lrn_1",
"type": "point",
"coords": {
"x": -3,
"y": 4
}
}, {
"id": "lrn_2",
"type": "point",
"coords": {
"x": 3,
"y": -2
}
}]
],
"valid_score": "1"
}
}
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 totrue
on the activity. Supports embedded Feature <span> tags. -
type string
Type of question being asked, e.g. 'association'
Default: "graphplotting"
-
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.height stringUnits
The height of the graph with trailing px unit eg. "600px".
Default: "600px"
-
ui_style.width stringUnits
The width of the graph with trailing px unit eg. "600px".
Default: "600px"
-
ui_style.margin stringUnits
The margin around the graph to make room for labels. Can be a single value, e.g. "20px", or a CSS formatted string e.g. "20px 10px 20px" (for margins with different values on each side). Note: Margin will default to 20px if there is a label and the margin value is not set.
Default: "0px"
-
ui_style.graph_controls string
Deprecated This attribute has been deprecated; consider using toolbar.controls instead.
-
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
Default: []
-
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
Default: []
-
validation.alt_responses[ ][ ].score number
Score if the alternative response is correct.
Default: 1
-
validation.alt_responses[ ][ ].value array
Default: []
-
validation.ignore_repeated_shapes string
When set to 'yes', scoring will ignore shapes which are plotted multiple times within the same composition (authored value is treated separately to student's response). When the value is set to 'strict', the shapes are only considered equal if the points are equivalent, not just the position and slope. See this article for more details: Using the Repeated Shapes Option in Graphing
Default: "no"
-
description string
Deprecated See stimulus_review.
Description of the question and its context to be displayed. It supports HTML entities. -
mode string
Defines the plotting mode to load. Possible values are: "all", "point", "line"
Default: "all"
-
axis_x object
Defines if Axis should be shown in the Cartesian plane
-
axis_x.ticks_distance string/number
The distance between the ticks displayed in the axis
Default: 1
-
axis_x.hide_ticks boolean
Defines if ticks are rendered in the axis
Default: false
-
axis_x.draw_labels boolean
Defines if labels are rendered in the axis
Default: false
-
axis_x.comma_in_label boolean
Inserts comma to separate thousands in a number
Default: false
-
axis_x.show_first_arrow boolean
Defines if an arrow should be rendered in the lower end of the axis
Default: false
-
axis_x.show_last_arrow boolean
Defines if an arrow should be rendered in the higher portion of the axis
Default: false
-
axis_x.show_axis_label boolean
Defines if the axis label should be rendered
Default: false
-
axis_x.axis_label string
Defines the label to be rendered next to X axis
Default: "X"
-
axis_y object
Defines if Axis X should be shown in the Cartesian plane
-
axis_y.ticks_distance string/number
The distance between the ticks displayed in the axis
Default: 1
-
axis_y.hide_ticks boolean
Defines if ticks are rendered in the axis
Default: false
-
axis_y.draw_labels boolean
Defines if labels are rendered in the axis
Default: false
-
axis_y.comma_in_label boolean
Inserts comma to separate thousands in a number
Default: false
-
axis_y.show_first_arrow boolean
Defines if an arrow should be rendered in the lower end of the axis
Default: false
-
axis_y.show_last_arrow boolean
Defines if an arrow should be rendered in the higher end of the axis
Default: false
-
axis_y.show_axis_label boolean
Defines if the axis label should be rendered
Default: false
-
axis_y.axis_label string
Defines the label to be rendered next to Y axis
Default: "Y"
-
canvas object
Specifies the canvas representing the Cartesian plane in which the user will be plotting
-
canvas.snap_to string/number
Defines the snap applied on points, possible values are: "grid", "ticks" or a numeric value
-
canvas.show_hover_position boolean
Defines if the position of a point should be displayed when hovering over or dragging it
Default: false
-
canvas.x_min number
X axis lower value
Default: -10
-
canvas.x_max number
X axis higher value
Default: 10
-
canvas.y_min number
Y axis lower value
Default: -10
-
canvas.y_max number
Y axis higher value
Default: 10
-
grid object
Defines the Grid to be drawn in the Cartesian plane
-
grid.x_distance string/number
Distance between grid lines perpendicular to the X axis
Default: 1
-
grid.y_distance string/number
Distance between grid lines perpendicular to the Y axis
Default: 1
-
annotation object
Object used to add annotations to the question. Eg, labels, comments, titles
-
annotation.title string
The graph title
-
annotation.label_top string
Label for the top of the graph
-
annotation.label_right string
Label for the right of the graph
-
annotation.label_bottom string
Label for the bottom of the graph
-
annotation.label_left string
Label for the left of the graph
-
toolbar object
Object that defines which tools are available and other options for the toolbar.
-
toolbar.tools array
An array containing either strings or a nested array of strings, defining the buttons or dropdown groups of tools that are available in the toolbar for this question.
Default: ["move","point","line"]
-
toolbar.default_tool string
The tool that will be set when the question is loaded.
Default: "Move"
-
toolbar.controls array
Determines options a user has for controlling graph elements.
Default: ["undo","redo","reset"]
-
draw_zero boolean
Defines whether to draw '0' label
Default: false
-
background_image object
-
background_image.src string
-
background_image.x number
X coordinate of the image's centre
Default: 0
-
background_image.y number
Y coordinate of the image's centre
Default: 0
-
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
-
display_points boolean
Defines whether to show points for background shapes or not
Default: true
-
background_shapes
Shapes that will be displayed as stimulus in the the background of the Canvas. Users will be able to see them but not be able to interact with them.
Response format
The data returned in the response format for this Question is the plot points, lines, or shapes that the student plotted on the coordinate grid.
Response format examples
{
"value": {
"actions": [
"point(-2,7) << id: 'lrn_1', showinfobox: true, snaptogrid: true, snapsizex: 1, snapsizey: 1 >>;",
"point(-4,3) << id: 'lrn_3', showinfobox: true, snaptogrid: true, snapsizex: 1, snapsizey: 1 >>;point(3,4) << id: 'lrn_2', showinfobox: true, snaptogrid: true, snapsizex: 1, snapsizey: 1 >>;circle(lrn_3,lrn_2) << id: 'lrn_4' >>;",
"lrn_2.move([0,4]);",
"lrn_3.move([0,3]);"
],
"undo": [
"remove(lrn_1);",
"remove(lrn_3);remove(lrn_2);remove(lrn_4);",
"lrn_2.move([3,4]);",
"lrn_3.move([-4,3]);"
],
"composition": [
{
"id": "lrn_1",
"type": "point",
"coords": {
"x": -2,
"y": 7
}
},
{
"id": "lrn_3",
"type": "point",
"coords": {
"x": 0,
"y": 3
},
"subElement": true
},
{
"id": "lrn_2",
"type": "point",
"coords": {
"x": 0,
"y": 4
},
"subElement": true
},
{
"id": "lrn_4",
"type": "circle",
"subElementsIds": {
"centrePoint": "lrn_3",
"radiusPoint": "lrn_2"
}
}
]
},
"type": "object",
"apiVersion": "v2.173.0",
"revision": 1,
"feedbackAttemptsCount": 1
}
Response attributes
-
value object
The points, lines, and/or shapes that the student plotted onto the coordinate grid.
-
value.actions array of strings
Contains the steps that the student took to draw each shape onto the graph.
-
value.undo array of strings
Contains the undo history for actions the student took on the graph.
-
value.composition array of objects
Contains all of the shapes and related points drawn on the graph.
-
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.