# equivValue

## Overview

equivValue compares numerical values that may be represented in different ways, such as 1L = 1000mL. equivValue will evaluate the expression to a numerical form for comparison. This means that as long as the value given by the student is equal to the result the author was expecting, the question will validate as correct.

Use equivValue if you are expecting a numeric result or if using units of measure.

• Tolerance

A plus-minus value can be added by authors to the correct response. This means that students can give a response with tolerance that will be deemed as correct. For example, if the valid response set by the author is $$10+-1.5$$, the student can respond with any value from $$8.5$$ to $$11.5$$ and get points. Bear in mind that tolerance only works with equivValue scoring. See Example 2 below.

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

• Significant decimal places

This option defines how many decimal places can be allowed in students responses. Default and maximum value is 10.

## Examples

Example 1 - Basic scoring with units

As long as the student's answer has the same value as the valid response the question will validate correct. Answers can be given in different units.

$$16.67g$$true
$$0.01667kg$$true
$$16670mg$$true
$$16.67$$false
$$16.7g$$false
{
"instant_feedback": true,
"is_math": true,
"stimulus": "<p>What mass of Magnesium oxide will be formed when 10g of Magnesium is burned in air?<\/p>\n",
"symbols": [
"chemistry",
"qwerty"
],
"type": "chemistry",
"ui_style": {
"type": "block-on-focus-keyboard"
},
"validation": {
"scoring_type": "exactMatch",
"valid_response": {
"score": 1,
"value": [
{
"method": "equivValue",
"options": {
"allowDecimal": false,
"inverseResult": false,
"ignoreOrder": false,
"decimalPlaces": 2
},
"value": "16.67g"
}
]
}
}
}

Example 2 - Tolerance Plus/Minus.

In this example, a tolerance of 0.002 has been added.

$$24.305g$$true
$$24.307g$$true
$$24.303g$$true
$$24305mg$$true
$$24.305$$false
{
"instant_feedback": true,
"is_math": true,
"stimulus": "<p>How many grams is one mole of Magnesium?<\/p>\n",
"symbols": [
"chemistry",
"qwerty"
],
"text_blocks": [],
"type": "chemistry",
"ui_style": {
"type": "block-on-focus-keyboard"
},
"validation": {
"scoring_type": "exactMatch",
"valid_response": {
"score": 1,
"value": [
{
"method": "equivValue",
"options": {
"allowDecimal": false,
"inverseResult": false,
"ignoreOrder": false,
"decimalPlaces": 3
},
"value": "24.305g\\pm0.002"
}
]
}
}
}

## Combining Methods

Example 3 - EquivValue + EquivLiteral - restricting unit types.

Combining equivValue with isUnit is a good method of narrowing down possible response options if needed. In this example, the answer should be given either in $$L$$ or $$mL$$. Listing $$L$$ and $$mL$$ in isUnit settings ensures that only correct values given in these units of measurement will be valid.

$$0.5895L$$true
$$589.5mL$$true
$$0.5895$$false
$$589mL$$false
{
"instant_feedback": true,
"is_math": true,
"stimulus": "<p>If the density of a 36% concentration of hydrochloric acid is 1.179g\/mL, what is the volume of 500g of this substance?<\/p>\n",
"symbols": [
"chemistry",
"qwerty"
],
"text_blocks": [],
"type": "chemistry",
"ui_style": {
"type": "block-on-focus-keyboard"
},
"validation": {
"scoring_type": "exactMatch",
"valid_response": {
"score": 1,
"value": [
{
"method": "equivValue",
"options": {
"allowDecimal": false,
"inverseResult": false,
"ignoreOrder": false,
"decimalPlaces": 4
},
"value": "0.5895L"
},
{
"method": "isUnit",
"value": "L,\\ mL",
"options": {
"ignoreOrder": false
}
}
]
}
}
}