Displaying Remaining Attempts
The number of attempts used and attempts remaining are available using Variables.
This example shows how to display it on a start attempt button using two assessment variables:
{{assessment:attemptsRemaining}}
{{assessment:attemptsAmount}}
Note: ActionButton’s
label
attribute does not support variables. Use of a textGroup is required.
<ObojoboDraftDoc>
<Module>
<Content> <!-- Pages of learning content --> </Content>
<Assessment id="my-assessment" attempts="3">
<Page>
<ActionButton>
<textGroup>
<t>Start Attempt ({{assessment:attemptsRemaining}} remaining)</t>
</textGroup>
<triggers>
<trigger type="onClick">
<actions>
<action type="assessment:startAttempt">
<value id="my-assessment" />
</action>
</actions>
</trigger>
</triggers>
</ActionButton>
</Page>
<QuestionBank>
<!-- ...-->
</QuestionBank>
<scoreActions>
<scoreAction for="[0,100]">
<Page>
<p>You have {{assessment:attemptsRemaining}} out of {{assessment:attemptsAmount}} attempts remaining.</p>
<ActionButton>
<textGroup>
<t>Start Attempt ({{assessment:attemptsRemaining}} remaining)</t>
</textGroup>
<triggers>
<trigger type="onClick">
<actions>
<action type="assessment:startAttempt">
<value id="my-assessment" />
</action>
</actions>
</trigger>
</triggers>
</ActionButton>
</Page>
</scoreAction>
</scoreActions>
</Assessment>
</Module>
</ObojoboDraftDoc>