The equivValue method compares numerical values that may be represented in different ways such as units of measurement. If you put 100cm in Value, a learner would also be marked correct for:
1m
1000mm (and so on)
But incorrect for 100mm.
equivValue will evaluate the expression to a numerical form for comparison. As long as the value given by the learner is mathematically equal to the Value the author sets, they will be marked correct.
equivValue works with decimals, fractions, and percentages. This method also handles the validation of lists and ranges, using the plus-minus (±).
Note: Although similar to equivSymbolic, the equivValue method cannot be used with variables.
Examples using equivValue
Example 1: Basic equivValue
As long as the learner's response has the same value as the response set by the author then their response will be correct. In this example, the Value has been set to 4.
In the image below you can see how 4, 2x2, and 4.0 have all been marked correct. However 4% is incorrect as it has a value of 0.04, not 4.
Example 2 - Using units
equivValue is very often used with units.
In the image below we can see that a value equal to 120cm given in any unit of measurement is marked correct.
Example 3: Constraining units
In this example, the answer should be given in either cm or m. Listing cm and m in isUnit settings ensures that only values given in these units of measurement will be correct.
Note: As answers will contain decimals we also need to select Allow decimal marks.
Also note that even though 0.0012km would be a valid response based on equivValue alone, this answer will be incorrect due to the specified isUnit restrictions.
When entering units in Value, a keyboard will pop up. Go to KG to find the SI units (International System of Units) available for marking with and enter as many as you like separated by a comma.
In the example learner responses below we can see that even though 0.0012km would be a valid response based on equivValue, it’s marked incorrect because it is not in the units we have specified.
Example 4: Tolerance (plus/minus)
A plus-minus can be included in the Value field, so that the correct response is within a range. In this example, we include a tolerance of 150g.
In the image below we can see that any values within the range of 700 to 1000g is marked as correct, regardless of which unit the answer is given in.
Example 5: Significant decimal places
The decimal places field is used to specify the number of significant decimal places in the response. In this example, decimal places is set to 2.
Learners will need to enter 2 (or more) decimal places to be marked correct. Note 7/3 is deemed correct as we have not specified a form.
Additional options for the equivValue marking method
Tolerance
Authors can add a plus-minus (±) to the correct value to allow for a range of values. For example, if the value is set to 10±1.5, learners will be marked correct for any value from 8.5 to 11.5. Tolerance works only with the equivValue method.
Allow decimal marks
Authors can specify what separators learners can use. From the Thousand Separator drop-down menu, you can select dot, comma, and/or space. The Decimal Separator menu contains the option for either a dot or a comma.
Note: Allow decimal marks has to be selected for these options to show and that the specified thousand separators and decimal separator cannot be the same, e.g. both dot.
Significant decimal places
This option defines how many significant decimal places can be allowed in learners’ responses. The default and maximum value is 10.
Ignore text
This refers to LaTeX text only, and when enabled will ignore any LaTeX text the student enters in the response area.
Compare sides
Used when comparing two constant equations, when both sides of an equation have not been fully specified, such as {{response}} + {{response}} = {{response}}. By default, expressions such as this will validate as isTrue. This means that as long as the expression is mathematically correct, it will validate even if the value entered is different from that specified in the validation area. However, enabling Compare Sides ensures that the response given is symbolically equal to the equation set in the validation area.