<hasSameFactoring>
<hasSameFactoring> is an Evaluation
component that returns the boolean value of true or false depending on
whether the two enclosed <math> or math references are factored in the same way.
Attributes and Properties
Attributes for <hasSameFactoring>
Other (16)
allowedErrorInNumbersnumber. Default value: 0. Maximum allowed numeric error when comparing numbers.
allowedErrorIsAbsoluteboolean. Default value: false. Whether allowedErrorInNumbers is interpreted as an absolute (rather than relative) tolerance.
allowOnlySignDifferencesboolean. Default value: false. Whether to count factorizations as equivalent when they differ only by sign.
caseInsensitiveMatchboolean. Default value: false. Whether text comparisons ignore letter case.
expandOnCompareboolean. Default value: false. Whether to expand math expressions before comparing.
includeErrorInNumberExponentsboolean. Default value: false. Whether the allowed numeric error also applies to numbers in exponents.
matchBlanksboolean. Default value: false. Whether unfilled blanks in a math expression count as a match.
matchByExactPositionsboolean. Default value: false. Whether to match list values by exact position rather than by content.
monomialFactorMustMatchboolean. Default value: false. Whether monomial factors must match exactly (implies restrictDivision).
numPeriodicSetMatchesRequiredinteger. Default value: 3. Number of consecutive elements of a periodic set required to count as a match.
numSignErrorsMatchednumber. Default value: 0. Maximum number of sign errors that still count as a match.
restrictDivisionboolean. Default value: false. Whether to disallow dividing through to match factored forms.
simplifyOnComparekeyword. Level of simplification applied to math expressions before comparing.
| Value | Description |
|---|---|
none (default) | No simplification is applied before comparing. |
full | Fully simplify both expressions before comparing. |
numbers | Simplify numeric subexpressions only, leaving symbolic structure intact. |
numbersPreserveOrder | Like numbers, but does not reorder commutative operands. |
normalizeOrder | Reorder commutative operands into a canonical form without simplifying values. |
symbolicEqualityboolean. Default value: false. Whether children compared via this boolean use symbolic equality.
unorderedCompareboolean. Default value: false. Whether order is ignored when comparing list-like values.
variable_variableName. Default value: . Variable used when comparing factored expressions.
Common to all components (9)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <hasSameFactoring name="h">
Other (18)
$h.allowedErrorInNumbersnumber. Maximum allowed numeric error when comparing numbers.
$h.allowedErrorIsAbsoluteboolean. Whether allowedErrorInNumbers is interpreted as an absolute (rather than relative) tolerance.
$h.caseInsensitiveMatchboolean. Whether text comparisons ignore letter case.
$h.disabledboolean. Whether this component is disabled and cannot be interacted with.
$h.expandOnCompareboolean. Whether to expand math expressions before comparing.
$h.fixedboolean. Whether this component's value is fixed and cannot be modified.
$h.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$h.includeErrorInNumberExponentsboolean. Whether the allowed numeric error also applies to numbers in exponents.
$h.matchBlanksboolean. Whether unfilled blanks in a math expression count as a match.
$h.matchByExactPositionsboolean. Whether to match list values by exact position rather than by content.
$h.numPeriodicSetMatchesRequiredinteger. Number of consecutive elements of a periodic set required to count as a match.
$h.numSignErrorsMatchednumber. Maximum number of sign errors that still count as a match.
$h.simplifyOnComparetext. Level of simplification applied to math expressions before comparing.
$h.symbolicEqualityboolean. Whether children compared via this boolean use symbolic equality.
$h.texttext. The boolean rendered as a text string ("true" or "false").
$h.unorderedCompareboolean. Whether order is ignored when comparing list-like values.
$h.valueboolean. Whether the input math expressions share the same factoring.
Common to all components (4)
$h.doenetMLtext. The DoenetML source code that produced this component.
$h.hideboolean. Whether to hide this component from the rendered output.
$h.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$h.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: basic use
The <hasSameFactoring> component is used to check that the user has
supplied a factored expression, while preserving some flexibility in the
manner of response. In order to evaluate to true, the entered expression must:
- contain two distinct binomial terms
- be mathematically equivalent to the factored expression
These requirements may be restricted further if desired, by applying additional
attributes to <hasSameFactoring>.