# isExpanded

## Overview

The isExpanded method checks that an expression is in its most expanded form.

isExpanded doesn’t take any value property, and is generally used as a supporting method in conjunction with equivSymbolic.

• Allow thousands separator

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.

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

## Example

isExpanded does not take any value, which means when used alone it will validate any mathematical expression presented at its most expanded form.

\(x\)true
\(x^2 + 3x\)true
\(x^2 + 5x + 6\)true
\(x^2+xy+3x+3y\)true
\(x(x + 3)\)false
\((x+3)(x+2)\)false
\((x+3)(x+y)\)false
``````{
"instant_feedback": true,
"is_math": true,
"stimulus": "Enter an expanded expression.",
"type": "formulaV2",
"ui_style": {
"type": "block-on-focus-keyboard"
},
"validation": {
"scoring_type": "exactMatch",
"valid_response": {
"score": 1,
"value": [
{
"method": "isExpanded"
}
]
}
}
}``````

## Combining Methods

Example

In this example, we combine isExpanded with equivSymbolic. isExpanded checks if the expression in the response is given in expanded form, and equivSymbolic ensures the expression matches the one in validation, i.e. symbolically equivalent to it. Note that you do not need to work the answer out for validation - enter the actual expression in equivSymbolic validation, and add the isExpanded method.

\(x^3 +3x^2y + 3x^2 +3y^2 +10xy\)true
\((x^2+3x+y)(x+3y)\)false
\(x ( x^2 +3xy + 3x +10y) +3y^2\)false
\(x^3 + 3x^2 + y(3x^2 +3y +10x)\)false
``````{
"instant_feedback": true,
"is_math": true,
"stimulus": "Enter an expanded expression that is symbolically equivalent to \\((x^2+3x+y)(x+3y)\\).",
"type": "formulaV2",
"ui_style": {
"type": "block-on-focus-keyboard"
},
"validation": {
"scoring_type": "exactMatch",
"valid_response": {
"score": 1,
"value": [
{
"method": "isExpanded",
"options": {
"inverseResult": false,
"decimalPlaces": 10
}
},
{
"method": "equivSymbolic",
"value": "(x^2+3x+y)(x+3y)",
"options": {
"inverseResult": false,
"decimalPlaces": 10
}
}
]
}
}
}``````