<answer>
Property Examples
The following examples illustrate use of the <answer> tag properties.
Properties
| Property | Type |
|---|---|
$a.allowedErrorInNumbers | number |
$a.allowedErrorIsAbsolute | boolean |
$a.caseInsensitiveMatch | boolean |
$a.creditAchieved | number |
$a.creditByAttempt | numberList |
$a.currentResponse | |
$a.currentResponses | |
$a.disableAfterCorrect | boolean |
$a.disabled | boolean |
$a.disabledOriginal | boolean |
$a.disableWrongChoices | boolean |
$a.displayDigitsForCreditAchieved | integer |
$a.displayDigitsForResponses | integer |
$a.expanded | boolean |
$a.expandOnCompare | boolean |
$a.feedbacks | [ feedback ] |
$a.fixed | boolean |
$a.fixLocation | boolean |
$a.forceFullCheckworkButton | boolean |
$a.handGraded | boolean |
$a.hidden | boolean |
$a.includeErrorInNumberExponents | boolean |
$a.inline | boolean |
$a.justSubmitted | boolean |
$a.matchBlanks | boolean |
$a.matchByExactPositions | boolean |
$a.matchPartial | boolean |
$a.maxNumAttempts | integer |
$a.numAttemptsLeft | integer |
$a.numAwardsCredited | integer |
$a.numFeedbacks | number |
$a.numPeriodicSetMatchesRequired | integer |
$a.numResponses | number |
$a.numSignErrorsMatched | number |
$a.numSubmissions | integer |
$a.numSubmittedResponses | number |
$a.parseScientificNotation | boolean |
$a.preserveLastChoice | boolean |
$a.responseHasBeenSubmitted | boolean |
$a.selectMultiple | boolean |
$a.shuffleOrder | boolean |
$a.simplifyOnCompare | text |
$a.splitSymbols | boolean |
$a.submitLabel | text |
$a.submitLabelNoCorrectness | text |
$a.submittedResponse | |
$a.submittedResponses | |
$a.symbolicEquality | boolean |
$a.unorderedCompare | boolean |
$a.weight | number |
Example: Attributes as properties 1
The <answer> attributes listed above are also accessible as properties.
Example: Attributes as properties 2
The <answer> attributes listed above are also accessible as properties.
Example: numResponses
The numResponses property of the named <answer> renders
the number of user-inputs, or the number of distinct response components considered when awarding credit.
Example: currentResponses
currentResponses is an array that could contain multiple values. Individual values
can be obtain with square brackets. For example, the second response can be accessed with currentResponses[2].
Example: numSubmittedResponses
In this example, the numSubmittedResponses property of the named <answer>
renders the number of responses that have been submitted for the answer. Once the “Check Work” button
has been clicked, this number does not change (even if the values submitted do change). A null response
also counts as a submitted response once the user has clicked the “Check Work” button.
Example: submittedResponses
submittedResponses is an array that could contain multiple values. Individual
values can be obtain with square brackets. For example, the second response can be accessed with submittedResponses[2].
Example: creditAchieved
Note: the creditAchieved property will always show the credit from the most recent
submission of the answer, even if assignment settings or due dates modify the actual credit awarded.
Example: responseHasBeenSubmitted
The responseHasBeenSubmitted property of a named <answer> component returns “true” if the
user has clicked the “Check Work” button and “false” otherwise.
Example: justSubmitted
The justSubmitted property of a named <answer> component returns “true” if the user
has clicked the “Check Work” button and has not changed the content. When the user modifies their answer,
the justSubmitted property turns to false.
Example: feedbacks
The feedbacks property renders any feedback that is defined within the <answer> itself.
To specify more customized feedback, use a <feedback> tag.
Example: numSubmissions
The numSubmissions property renders the number of times the student has clicked the “Check Work” button.
Example: numAttemptsLeft
The numAttemptsLeft property renders the remaining number of times the student can a response.
It is only relevant when the maxNumAttempts attribute is used.