The isUnit method checks if an expression contains the units you have specified as the author. Combining equivValue with isUnit is a good method for narrowing possible responses when it is needed.
Example: 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.
When entering units in Value, a keyboard will pop up. Scroll down to and select KG to find the SI 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.
Additional Options
Allow thousands separator
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.