Referenceanswer (Properties)

<answer>

Property Examples

The following examples illustrate use of the <answer> tag properties.

Properties

Props for <answer name="a">
PropertyType
$a.allowedErrorInNumbersnumber
$a.allowedErrorIsAbsoluteboolean
$a.caseInsensitiveMatchboolean
$a.creditAchievednumber
$a.creditByAttemptnumberList
$a.currentResponse
$a.currentResponses
$a.disableAfterCorrectboolean
$a.disabledboolean
$a.disabledOriginalboolean
$a.disableWrongChoicesboolean
$a.displayDigitsForCreditAchievedinteger
$a.displayDigitsForResponsesinteger
$a.expandedboolean
$a.expandOnCompareboolean
$a.feedbacks[ feedback ]
$a.fixedboolean
$a.fixLocationboolean
$a.forceFullCheckworkButtonboolean
$a.handGradedboolean
$a.hiddenboolean
$a.includeErrorInNumberExponentsboolean
$a.inlineboolean
$a.justSubmittedboolean
$a.matchBlanksboolean
$a.matchByExactPositionsboolean
$a.matchPartialboolean
$a.maxNumAttemptsinteger
$a.numAttemptsLeftinteger
$a.numAwardsCreditedinteger
$a.numFeedbacksnumber
$a.numPeriodicSetMatchesRequiredinteger
$a.numResponsesnumber
$a.numSignErrorsMatchednumber
$a.numSubmissionsinteger
$a.numSubmittedResponsesnumber
$a.parseScientificNotationboolean
$a.preserveLastChoiceboolean
$a.responseHasBeenSubmittedboolean
$a.selectMultipleboolean
$a.shuffleOrderboolean
$a.simplifyOnComparetext
$a.splitSymbolsboolean
$a.submitLabeltext
$a.submitLabelNoCorrectnesstext
$a.submittedResponse
$a.submittedResponses
$a.symbolicEqualityboolean
$a.unorderedCompareboolean
$a.weightnumber

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.