<answer>
Basic Use Examples
<answer>
is an Evaluation component that
defines content for which the user is awarded credit or is required to provide a response.
The following examples illustrate some of the basic answer forms.
See the following pages for more complex examples, attributes and properties.
Example: Default math <answer>
Note that, by default, any expression that is mathematically equivalent to is considered correct, so the user can type the given expression and receive full credit in this case. See further examples on how to refine this behavior.
Example: Default text <answer>
Value entered into the <textInput/>
must match exactly (default is case-sensitive) to the
provided response, excluding white space at the beginning and end.
Example: <answer>
with multiple awards
One or more <award>
components enclosing correct responses may be nested inside
an <answer>
component to give credit for different answers. Individual awards may
also have different credit values assigned, see further examples on how to refine awarding for partial credit.
Example: <answer>
with basic logic
This example illustrates the use of some simple validation logic that can be constructed
with an <answer>
tag that references a named <mathInput/>
. Credit is
awarded when the boolean contained within the <when>
component evaluates to true.
Multiple <award>
components may also be used for answers with more complex validation logic.
Example: <answer>
for graded free-response
The handGraded
attribute defers grading for a human to score later.
When combined with the expanded
attribute of a text answer, the result is a
graded free-response style question. The forceFullCheckworkButton
attribute was added just for aesthetics.