equivLiteral

Overview

The equivLiteral method checks if the response from the student is literally equal to the correct value specified by the Author. This means that the form, order, elements, and values entered by the student should match the value in validation. Responses that are mathematically equal, but are in a form other than the one specified by Authors, will return false. Use equivLiteral when you want to strictly specify a particular form of the mathematical expression as the correct answer.

Note that equivLiteral ignores parentheses which have no specific meaning, by default.


  • Allow decimal marks

    Authors can specify what separators can be used by the student. 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 that the specified thousand separator and decimal separator cannot be the same, e.g. both dot.


  • Ignore order

    Ignores the order of expressions. E.g. both \(x+1\) and \(1+x\) will be considered correct. If this is not enabled, equivLiteral will not accept the correct response specified by the Author in a different order, even if it is an acceptable answer.


  • Inverse result

    Enabling this means that the value specified in the Value field will not be accepted as the correct answer. It is a useful way of excluding very specific answers from validation.
    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 adding an additional scoring method equivLiteral and enabling Inverse Result will exclude \((x + 2)^2\) from correct response options. See examples in the Combining Methods section below.


  • Allow interval

    This option must be enabled when the students are expected to insert interval notation in the response area. Otherwise, the response will not validate correctly.


  • Ignore trailing zeros

    This option allows equivLiteral to ignore zeros after decimal separators in students responses. For example, when this option is enabled, \(1000\) and \(1000.000\) will be treated as equal.


  • Ignore coefficient of 1

    When enabled, the coefficient of \(1\) before an integer will be ignored. E.g. equivLiteral will treat \(1x+2\) and \(x+2\) as equal.




Examples

Example 1 - Basic equivLiteral scoring.

EquivLiteral only accepts a response that is mathematically equal to the response set in the validation settings, and given in the same form. Note that parentheses that do not impact the mathematical result are ignored by default.

AnswerMarking
\(2\)true
\((2)\)true
\(1 + 1\)false
\(\frac{4}{2}\)false
\(2 + 0\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\(2\\)",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "2",
                    "options": {
                        "ignoreOrder": false,
                        "inverseResult": false
                    }
                }
            ]
        }
    }
}


Example 2 - equivLiteral with decimals.

When using equivLiteral with decimals students, will not be punished for not putting the integer before the dot. However, the trailing zeros will be taken into account unless Ignore Trailing Zeros is enabled.

AnswerMarking
\(.5\)true
\(0.5\)true
\(.50\)false
\(\frac{1}{2}\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\(0.5\\)",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": ".5",
                    "options": {
                        "ignoreOrder": false
                    }
                }
            ]
        }
    }
}


Example 3 - EquivLiteral with decimals.

This is the same question as above, only with Ignore Trailing Zeros option enabled. This allows equivLiteral to ignore trailing zeros in students responses.

AnswerMarking
\(.5\)true
\(0.5\)true
\(0.50000\)true

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\(0.5\\)",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": ".5",
                    "options": {
                        "ignoreOrder": false,
                        "inverseResult": false,
                        "ignoreTrailingZeros": true
                    }
                }
            ]
        }
    }
}


Example 4 - equivLiteral with fractions.

When using equivLiteral with fractions, authors should bear in mind that only the fraction of the same form will be accepted. Decimal equivalent or other ways of expression will be considered incorrect.

AnswerMarking
\(\frac{1}{2}\)true
\(0.5\)false
\(1\div2\)false
\(50%\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\(\\frac{1}{2}\\)",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "\\frac{1}{2}",
                    "options": {
                        "ignoreOrder": false
                    }
                }
            ]
        }
    }
}


Example 5 - equivLiteral with negative fractions.

When working with negative fractions, remember that the minus should belong to the fraction as a whole, and not to the nominator or denominator.

AnswerMarking
-\(\frac{1}{4}\)true
\(\frac{-1}{2}\)false
\(\frac{1}{-2}\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\(-\\frac{1}{4}\\)",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "-\\frac{1}{4}",
                    "options": {
                        "ignoreOrder": false
                    }
                }
            ]
        }
    }
}


Example 6 - equivLiteral with variables.

equivLiteral works with variables. In this example the Ignore Coefficient of 1 option is enabled. It allows equivLiteral to treat \(1x\) and \(x\) as equal.

AnswerMarking
\(x\)true
\(1x\)true
\(x + 0\)false
\(2x\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "<p>Enter anything literally equivalent to&nbsp;\\(x\\)<\/p>\n",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "options": {
                        "inverseResult": false,
                        "decimalPlaces": 10,
                        "ignoreOrder": false,
                        "ignoreCoefficientOne": true
                    },
                    "value": "x"
                }
            ]
        }
    }
}


Example 7 - equivLiteral fill in the blanks.

In this question, the students enter values in the response boxes in order to complete the equation. In this example, the order of responses matters.

AnswerMarking
\(2.5 + 3 \)true
\(3 + 2.5\)false
\(2 \frac{1}{2} + 3\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\(2.5+3=5.5\\)",
    "template": "{{response}} + {{response}} = 5.5",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "2.5+3=5.5",
                    "options": {
                        "ignoreOrder": false,
                        "inverseResult": false
                    }
                }
            ]
        }
    }
}


Example 8 - equivLiteral fill in the blanks.

This is the same example, only with Ignore Order enabled. In this case order of responses does not matter.

AnswerMarking
\(2.5 + 3 \)true
\(3 + 2.5\)true
\(2 \frac{1}{2} + 3\)false
\(2 + 3.5\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\(2.5+3=5.5\\)",
    "template": "{{response}} + {{response}} = 5.5",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "2.5+3=5.5",
                    "options": {
                        "ignoreOrder": true,
                        "inverseResult": false
                    }
                }
            ]
        }
    }
}


Example 9 - equivLiteral with algebraic expressions.

The question will validate correct only if the exact same expression is entered, however the element order will not be taken into account as Ignore Order is enabled.

AnswerMarking
\((x + 2)^2\)true
\((x + 2)^{(2)}\)true
\((2 + x)^2\)true
\(x^2+xy+3x+3y\)false
\( x^2 + 4x + 4\)false
Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\((x + 2)^2\\).",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "(x +2)^2",
                    "options": {
                        "ignoreOrder": true
                    }
                }
            ]
        }
    }
}


Example 10 - equivLiteral with trigonometry questions.

equivLiteral recognises trigonometric functions.

AnswerMarking
\(tan x\)true
\(tan (x)\)true
\(\frac{\sin x}{\cos x}\)false
Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\(\\tan x\\)",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "\\tan x",
                    "options": {
                        "ignoreOrder": false
                    }
                }
            ]
        }
    }
}


Example 11 - Using Ignore Order.

This is an example of a nested list question. The question will validate correct even if intervals are listed in the order different from the one in validation. Note that numbers inside intervals should not be reordered.

AnswerMarking
\((1,3),(8,6),(7,3),(-5,-2),(-4,1)\)true
\((-4,1),(1,3),(-5,-2),(7,3),(8,6)\)true
\((3,1),(8,6),(7,3),(-5,-2),(-4,1)\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter the following list in any order\\(\\left(1,3\\right), \\left(8,6\\right),\\left(7,3\\right), \\left(-5,-2\\right), \\left(-4,1\\right)\\)",
    "template": "{{response}},  {{response}} , {{response}} , {{response}}, {{response}}",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "\\left(1,3\\right),\\left(8,6\\right),\\left(7,3\\right),\\left(-5,-2\\right),\\left(-4,1\\right)",
                    "options": {
                        "ignoreOrder": true,
                        "inverseResult": false
                    }
                }
            ]
        }
    }
}


Example 12 - Dealing with thousand separators and trailing zeros.

The Allow Thousand Separator option allows the use of separators in numbers greater than thousand. Authors can select either comma or dot as thousand and decimal separators. Ignore Trailing Zeros is also enabled. This allows different formats of writing thousands to be validated correctly.
In this example comma is set as thousand separator and dot is decimal separator.

AnswerMarking
\(2,000.00\)true
\(2,000\)true
\(2000\)true
\(2000.00\)true
\(2.000,00\)false
\(2000,00\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\(2000\\)",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "2000",
                    "options": {
                        "ignoreOrder": false,
                        "inverseResult": false,
                        "allowThousandsSeparator": true,
                        "setThousandsSeparator": [
                            ","
                        ],
                        "setDecimalSeparator": ".",
                        "ignoreTrailingZeros": true
                    }
                }
            ]
        }
    }
}


Example 13 - Authoring questions with interval notations.

When working with interval notations (e.g. non-matching bracket types) enabling Allow Interval will ensure validation will be handled correctly, i.e. only non-matching brackets will validate correct, using round brackets will return false.

AnswerMarking
\((0,4]\)true
\((0,4)\)false
\([0,4]\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something literally equivalent to \\((0,4]\\)",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivLiteral",
                    "value": "\\left(0,4\\right]",
                    "options": {
                        "ignoreOrder": false,
                        "inverseResult": false,
                        "allowInterval": true
                    }
                }
            ]
        }
    }
}

Combining Methods

Example - equivLiteral + equivSymbolic with Inverse Result.

In this example, the flexible equivSymbolic scoring rules are constrained by a supporting equivLiteral method, with Inverse Result enabled. Valid responses in these two methods are the same, however putting it in the equivSymbolic settings allows correct responses in various formats, while equivLiteral ensures that students will not be able to score points for the exact same expression as the one in the question stimulus.

AnswerMarking
\(2(1+x)\)true
\(2x+2\)true
\(2+2x\)true
\(2x+\frac{4}{2}\)true
\(2(x+1)\)false
\(2x+1\)false

Source
{
    "instant_feedback": true,
    "is_math": true,
    "stimulus": "Enter something symbolically equivalent to \\(2\\left(x+1\\right)\\)",
    "type": "formulaV2",
    "ui_style": {
        "type": "block-on-focus-keyboard"
    },
    "validation": {
        "scoring_type": "exactMatch",
        "valid_response": {
            "score": 1,
            "value": [
                {
                    "method": "equivSymbolic",
                    "value": "2\\left(x+1\\right)",
                    "options": {
                        "inverseResult": false,
                        "decimalPlaces": 10
                    }
                },
                {
                    "method": "equivLiteral",
                    "value": "2\\left(x+1\\right)",
                    "options": {
                        "ignoreOrder": false,
                        "inverseResult": true
                    }
                }
            ]
        }
    }
}