Chemistry formula (chemistry)
Allows the learner to enter chemistry formulas with a formula keypad.
The chemistry formula Question is referenced by its type
in the code, which is "chemistry"
.
- Read the authoring documentation for a description of what this Question does.
Examples
{
"response_id": "60035",
"instant_feedback": true,
"is_math": true,
"stimulus": "Fill the gaps to balance a chemical equation:",
"type": "chemistry",
"template": "C_{{{response}}} + {{response}}O_2=2CO_{{{response}}}",
"validation": {
"scoring_type": "exactMatch",
"valid_response": {
"score": 1,
"value": [{
"method": "equivLiteral",
"value": "C_2+2O_2=2CO_2"
}]
}
}
}
Attributes
-
type string
Type of question being asked, e.g. 'association'
Default: "chemistry"
-
text_blocks array[string]
In the formula keypad, this allows certain characters to be rendered as text instead of LaTeX. For example, you might want to treat the characters for
cm
(centimeters) as a text string instead of being treated as two mathematical variables, i.e.c × m
.Note Each text block has a maximum length of 9 characters.
See Using the Text Blocks Option for more information.
Default:
[]
-
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. -
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.response_font_scale string
Changes the size of the font relative to the current page.
Default:
"boosted"
Possible values
-
"boosted"
- 150% font size. -
"normal"
- 100% font size.
-
-
ui_style.type string
Select the type of keypad for the learners to use.
See Keypad Customization for more information.
Default:
"floating-keyboard"
Possible values
-
"floating-keyboard"
- A movable keypad appears when the learner brings focus into the response box. -
"block-keyboard"
- A fixed keypad that is always visible. -
"block-on-focus-keyboard"
- A fixed keypad appears when the learner brings focus into the response box. -
"no-input-ui"
- Remove the keypad.
-
-
ui_style.min_width string
Controls the minimum width of the response input area, in pixels.
Example:
550px
-
ui_style.transparent_background boolean
Controls whether the background of the overall response area should be transparent or not.
Default:
false
-
ui_style.keyboard_below_response_area boolean
Controls whether the floating formula keypad is positioned below the individual response areas or below the entire Question content.
Default:
false
-
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 scores are distributed for the Question.
Default:
"exactMatch"
Possible values
- Exact Match - All parts of the Question must be answered correctly to receive a score.
- 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.
-
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[object]
The configuration for correct responses.
Default:
[]
-
validation.valid_response.value[ ].method string
The scoring method used to compare the learner's input against the correct answer (valid response value).
See Legacy Scoring Articles for more information.
Default:
"equivLiteral"
Possible values
"equivSymbolic"
"equivLiteral"
"equivValue"
"stringMatch"
"equivSyntax"
"isTrue"
-
validation.valid_response.value[ ].value string
The value of the correct answer to match against.
Default:
""
-
validation.valid_response.value[ ].aria_label string
A plain text version of the correct answer, available in review state for screen readers.
Default:
""
-
validation.valid_response.value[ ].options object
Additional options for the selected scoring method.
See below for configurable attributes.
-
validation.valid_response.value[ ].options.ignoreLeadingAndTrailingSpaces boolean
Ignores any leading and trailing spaces from the learner's response. When set to
true
, it will treat' a '
and'a'
as the same response, for example.Default:
true
-
validation.valid_response.value[ ].options.treatMultipleSpacesAsOne boolean
Ignores multiple spaces in a row entered by the learner. For example, when set to
true
, it allows treating'a b'
(with two intervening spaces) and'a b'
(with one space) as the same answer.Default:
true
-
validation.valid_response.value[ ].options.inverseResult boolean
The learner cannot use the provided example as the answer. For example, when this option is set to
true
and learners are asked to enter something symbolically equivalent to(x+2)^2
, entering the same example expression(x+2)^2
will not score points for that response.Default:
false
-
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 of objects containing the valid response.
Default: []
-
validation.alt_responses[ ].value[ ].method string
The method used to compare user input against the valid response value.
Default: "equivLiteral"
-
validation.alt_responses[ ].value[ ].value string
The value to match against
Default: ""
-
validation.alt_responses[ ].value[ ].aria_label string
A plain text version of the correct answer, available in review state for screen reader users
Default: ""
-
validation.alt_responses[ ].value[ ].options object
Extra options for the selected method.
-
validation.alt_responses[ ].value[ ].options.ignoreLeadingAndTrailingSpaces boolean
Setting it to true allows treating ' a ' and 'a' as the same.
Default: true
-
validation.alt_responses[ ].value[ ].options.treatMultipleSpacesAsOne boolean
Setting it to true allows treating 'a b' and 'a b' as the same.
Default: true
-
validation.alt_responses[ ].value[ ].options.inverseResult boolean
Return the opposite result
Default: false
-
handwriting_recognises string
A string with the name of one of the available math grammar sets.
Default:
"standard"
-
template string
An initial expression containing LaTeX with response areas for the learner to enter their response. Learner response areas can be predefined using
{{response}}
. -
showHints boolean
In the formula keypad, hovering the mouse over any button will show the button's title and keyboard shortcut. This option controls whether this tooltip should be shown.
Default:
true
-
horizontal_layout boolean
For the formula keypad, controls whether to use a simplified horizontal keypad with two rows of buttons, instead of the standard keypad layout.
Default:
false
-
response_container object
Configuration options for the response areas where a learner enters their response.
-
response_container.height string
The default height of all response containers, in pixels.
Example:
100px
-
response_container.width string
The default width of all response containers, in pixels.
Example:
100px
-
response_container.aria_label string
The ARIA label for all response containers for screen readers.
Default: Response area
-
response_containers array[object]
Configuration options for the individual response areas where a learner enters their response.
See below for configurable attributes.
-
response_containers[ ].height string
The default height of the individual response container, in pixels.
Example:
100px
-
response_containers[ ].width string
The default width of the individual response container, in pixels.
Example:
100px
-
symbols array[string|object]
A list of preset keypads available for the learner to use in the formula keypad.
Custom keypads can be defined as an object, see below for configurable attributes.
Default:
["chemistry","basic","qwerty"]
-
symbols[ ] string
The name of the preset keypad to be included in the formula keypad.
See Keypad Customization for more information.
Possible values
"algebra"
"basic"
"basic_junior"
"calculus"
"chemistry"
"comparison"
"discrete"
"general"
"geometry"
"greek"
"grouping"
"matrices"
"misc"
"qwerty"
"sets"
"trigonometry"
"units_si"
"units_us"
-
numberPad array[string]
Define a custom set of symbols for the learner's keypad.
Default:
["7", "8", "9", "÷", "4", "5", "6", "multiply", "1", "2", "3", "minus", "0", "decimal", "comma", "plus", "left", "right", "backspace", "="]
Example:
["7", "8", "9", "multiply", "="]
-
numberPad[ ] string
The individual keypad symbol to include.
For all supported symbols, see the Learnosity authoring interface.
See Keypad Customization for more information.
Response format
The data returned in the response format for this Question is a string, which is the chemistry formula that the learner entered.
Response format examples
{
"value": "H^2\ O",
"type": "string",
"responses": ["H^2\ O"],
"apiVersion": "v2.173.0",
"revision": 1,
"feedbackAttemptsCount": 1
}
Response attributes
-
value string
The full LaTeX chemistry formula content that the learner entered including the surrounding template.
-
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
"string"
. -
responses array[string]
Contains the LaTeX content that the learner entered into each individual response box when multiple response boxes are contained in the content. These response boxes are the scoreable answers.
-
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.