<and>
<and> is a Logic component
which checks to see whether all enclosed <boolean> references are true.
Attributes and Properties
Attributes for <and>
Other (12)
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.
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.
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.
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.
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 <and name="a">
Other (18)
$a.allowedErrorInNumbersnumber. Maximum allowed numeric error when comparing numbers.
$a.allowedErrorIsAbsoluteboolean. Whether allowedErrorInNumbers is interpreted as an absolute (rather than relative) tolerance.
$a.caseInsensitiveMatchboolean. Whether text comparisons ignore letter case.
$a.disabledboolean. Whether this component is disabled and cannot be interacted with.
$a.expandOnCompareboolean. Whether to expand math expressions before comparing.
$a.fixedboolean. Whether this component's value is fixed and cannot be modified.
$a.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$a.includeErrorInNumberExponentsboolean. Whether the allowed numeric error also applies to numbers in exponents.
$a.matchBlanksboolean. Whether unfilled blanks in a math expression count as a match.
$a.matchByExactPositionsboolean. Whether to match list values by exact position rather than by content.
$a.numPeriodicSetMatchesRequiredinteger. Number of consecutive elements of a periodic set required to count as a match.
$a.numSignErrorsMatchednumber. Maximum number of sign errors that still count as a match.
$a.simplifyOnComparetext. Level of simplification applied to math expressions before comparing.
$a.symbolicEqualityboolean. Whether children compared via this boolean use symbolic equality.
$a.texttext. The boolean rendered as a text string ("true" or "false").
$a.unorderedCompareboolean. Whether order is ignored when comparing list-like values.
$a.valueboolean. The boolean result of applying this operator to its child boolean values.
Common to all components (4)
$a.doenetMLtext. The DoenetML source code that produced this component.
$a.hideboolean. Whether to hide this component from the rendered output.
$a.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$a.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <and> in a <boolean>
The <and> component functions as the boolean operator and or &, and checks to see
whether all enclosed <boolean> references are true.
Example: <and> in an <award>
An <and> component is used to construct a compound boolean from three referenced <boolean> components
within an <award>.
Example: An alternative to <and>
The word and may be typed directly within any component that takes a boolean
expression, such as an <award>, a <when>, or a <boolean>. The text syntax must be used within a
boolean expression inside an attribute’s specification (since components such as <and> are not
permissible in attribute specification). Compare the syntax in the example above
with that in the example with <and> in a <boolean>.