Referenceaward (Attributes 2)

<award>

Attribute Examples Part 2

The following examples illustrate use of the <award> tag attributes.


Attribute Example: matchByExactPositions

The attribute matchByExactPositions influences how the matchPartial calculates partial credit involving vectors, lists, and related quantities. Without matchByExactPositions, the vectors (3,1,2) and (1,2,3) would be deemed by matchPartial to have a 67% match, as both contain the sequence 1,2, even though no components match. With matchByExactPositions, they would have a 0%0 \% match, as none of the first, second or third coordinates match.

In general, for a comparison of vectors, one would want to include matchByExactPositions along with matchPartial to give partial credit only for matches in a coordinate.
For comparing ordered lists, matchByExactPositions may not be desired.

matchByExactPosition implies an ordered comparison, so attributes like unorderedCompare and unordered are ignored.


Attribute Example: allowedErrorInNumbers and allowedErrorIsAbsolute

The allowedErrorInNumbers attribute may be used to specify a tolerance on numerical values that are considered to be correct. If the answer includes variables as well as numbers, using the symbolicEquality attribute will typically give more precise behavior.

By default, the error tolerance is specified as a fraction of the absolute value of the correct response.

The allowedErrorIsAbsolute attribute will change the tolerance to be specified as an absolute number.


Attribute Example: allowedErrorIsAbsolute

To specify an allowed error with a specific numerical value (rather than as a fraction of the correct response), use the allowedErrorIsAbsolute attribute in combination with the allowedErrorInNumbers attribute.


Attribute Example: includeErrorInNumberExponents

By default, allowedErrorInNumbers does not apply to exponents so that x2.01x^{2.01} is not considered within 1%1 \% of x2x^2. To allow error in such exponents, add the includeErrorInNumberExponents attribute, preferably with the symbolicEquality attribute.


Attribute Example: caseInsensitiveMatch

Use the caseInsensitiveMatch attribute if capitalization is not relevant for validation.


Attribute Example: matchBlanks

If a mathematical expression is incomplete, such as 3+(), it may contain blanks that are rendered by an underscore or a gray square.
Since such blanks typically indicate an error in a mathematical expression, any expression with a blank will, by default, never match a correct answer. To valid as correct a response that includes a blank, add the matchBlanks attribute to the <answer>.


Attribute Example: feedbackText

The feedbackText attribute will assign a particular feedback message to the answer when the award is matched. To display feedbacks associate to the answer, render the feedbacks property of the <answer>.


Attribute Example: referencesAreResponses

If an <answer> has an embedded input field, then Doenet knows that input is the user’s response.
Absent such input, Doenet will guess that any value copied into an award is the user’s response.
One way to tell Doenet what is the user’s response is by setting the referencesAreResponses to names of components. Then any values copied into the <award> from those components will be considered the user’s response.

Properly annotating DoenetML to specify the user’s response will help Doenet collect better data and better understand how user’s are learning.
Other ways to annotate user responses are:

  1. Add the isResponse attribute to responses that are copied into the <award>.
  2. Add a <considerAsResponses> child to the <answer> and copy anything that should be considered a reponse into the <considerAsResponses>.

Specifying the user’s response will also let you use the submittedResponses and currentResponses properties of the <answer>.