# equivLiteral

## Overview

The equivLiteral method checks if a chemistry expression is literally equal to the one set in validation. Both expressions should have the same form, order, elements, and values. Student responses that are equal to the response set in validation, but are in a form other than the one specified by authors, will return false. Use equivLiteral when you want to specify a particular form of the chemical expression as the correct answer.

• Ignore order

Ignores the order of terms and factors. E.g. both $$x+1$$ and $$1+x$$ will be considered correct.

• Inverse result

This will invert the response specified in validation. This means that any response will be correct except for the one set by the author.
Use case: Students are asked to enter something symbolically equivalent to $$(x+2)^2$$, however you don't want them to enter the same expression and score points for such response. In this case enabling Inverse Result will exclude $$(x+2)^2$$ from correct responses.

## Examples

Example 1 - Basic equivLiteral scoring.

Use eqivLiteral scoring for chemistry questions when there is only one possible correct response.

$$H_2O$$true
$$H^{_2}O$$false
$$1H_2O$$false

{
"instant_feedback": true,
"stimulus": "Write a formula for water",
"type": "chemistry",
"ui_style": {
"type": "block-on-focus-keyboard"
},
"validation": {
"scoring_type": "exactMatch",
"valid_response": {
"score": 1,
"value": [
{
"method": "equivLiteral",
"value": "H_2O",
"options": {
"ignoreOrder": false
}
}
]
}
}
}

Example 2 - Ignore Order

In questions where students are asked to balance chemistry equations, use equivLiteral scoring with Ignore Order enabled. This will ensure the order of the elements will not affect validation.

$$6O_2(g) + C_6H_{12}O_6(s)$$true
$$C_6H_{12}O_6(s) + 6O_2(g)$$true
$$O_2+C_6H_{12}O_6$$false

{
"instant_feedback": true,
"is_math": true,
"stimulus": "<p>Input the product&nbsp;of the supplied reactants to balance this&nbsp;equation&nbsp;for Photosynthesis:&nbsp;<\/p>\n",
"symbols": [
"chemistry",
"qwerty"
],
"template": "6CO_2(g)+6H_2O(l)\\rightarrow{{response}}",
"text_blocks": [],
"type": "chemistry",
"ui_style": {
"type": "block-on-focus-keyboard"
},
"validation": {
"scoring_type": "exactMatch",
"valid_response": {
"score": 1,
"value": [
{
"method": "equivLiteral",
"options": {
"allowDecimal": false,
"inverseResult": false,
"ignoreOrder": true
},
"value": "6CO_2(g)+6H_2O(l)\\rightarrow6O_2\\left(g\\right)+C_6H_{12}O_6\\left(s\\right)"
}
]
}
}
}

Example 3 - Cloze Chemistry

In this example, the students are asked to enter the correct answer in the response box. The response should match the value set in validation.

$$2.165$$true
$$2.165g/cm^{_3}$$false
$$2.16$$false

{
"instant_feedback": true,
"is_math": true,
"response_container": {
"height": "30px",
"width": "50px"
},
"stimulus": "<p>A brick of salt has a volume of 200cm3&nbsp;and weights 433 g. What is its density?<\/p>\n",
"symbols": [
"chemistry",
"qwerty"
],
"template": "<p>{{response}} g\/cm<sup>3<\/sup><\/p>\n",
"type": "clozechemistry",
"ui_style": {
"type": "block-on-focus-keyboard"
},
"validation": {
"scoring_type": "exactMatch",
"valid_response": {
"score": 1,
"value": [
[
{
"method": "equivLiteral",
"value": "2.165",
"options": {
"inverseResult": false,
"ignoreOrder": false
}
}
]
]
}
}
}

Example 4 - Cloze Chemistry - Multiple responses.

This is a cloze question with 4 response boxes. The order of responses cannot be changed.

$$2, 1, 3, 2$$true
$$2, 3, 1, 2$$false
$$3, 2, 1, 1$$false

{
"is_math": true,
"instant_feedback": true,
"stimulus": "<p>Input numbers in each box to form a balanced equation.<\/p>\n",
"symbols": [
"chemistry",
"qwerty"
],
"template": "{{response}}\$$FeCl_3+\$${{response}}\$$Be_3(PO_4)_2\\rightarrow\$${{response}}\$$BeCl_2+\$${{response}}\$$FePO_4\$$",
"type": "clozechemistry",
"ui_style": {
"type": "block-on-focus-keyboard"
},
"validation": {
"scoring_type": "partialMatch",
"valid_response": {
"score": 1,
"value": [
[
{
"method": "equivLiteral",
"value": "2",
"options": {
"allowDecimal": false,
"inverseResult": false,
"ignoreOrder": false
}
}
],
[
{
"method": "equivLiteral",
"value": "1",
"options": {
"ignoreOrder": false
}
}
],
[
{
"method": "equivLiteral",
"value": "3",
"options": {
"ignoreOrder": false
}
}
],
[
{
"method": "equivLiteral",
"value": "2",
"options": {
"ignoreOrder": false
}
}
]
]
}
}
}