Summary of the request:
- Learner needs to click a specific region, two attempts are allowed.
- On Success the Success message appears and the project advances to the next slide.
- On First failure a Hint message appears and an arrow indicates where to click. Moreover a Retry button appears.
- When the Retry button is clicked the Hint text and arrow should disappear.
- If second attempt is successful, Success message appears and the project advances to the next slide.
- If the second attempt is failed, a Sorry message appears with a Continue button to go to the next slide.
Contrary to the previous article, the slide is created manually (no click boxes are added automatically as in a simulation). For that reason I preferred shape buttons over click boxes. A shape button can be made invisible by setting Opacity and Stroke to zero.
The same idea is at the origin of the workflow: at the bottom of the Timeline, a shape button (invisible to the learner) covering the full slide is added. Have a look at this screenshot of the Timeline of the first slide (Flags):
The Success event of this big shape button will trigger the FailureAct action to show the Failure messages.
Watch a scalable version using this link. The fixed resolution version is below:
The Timeline screenshot of the first slide (Flags) shows the objects on this slide, from bottom to top:
- The shape button covering the slide SB_Back. This button will trigger an advanced action 'FailureAct' with the Success event!
- Gr_Flags groups the four flag images
- Title which function as instruction
- A multistate shape SS_Failure. The normal state is invisible (same as the shape buttons), it has a state for the two Failure situations. The Hint message is stored in a user variable v_hint. Reason: this allows to time this message shape for the rest of the project. The workflow is needed in a sequence of similar slides, message can be hidden when no longer needed.
- Shape button SB_Next, also a multistate object. I took out the Rollover and Down states, but it has a custom state 'Second' where the label changed to 'Continue'.
- Shape button SB_Flags, multistate object where the custom state 'Indicator' adds the arrow pointing to the correct location. This shape button is 'invisible' and over the Belgian flag on the first slide, over Portugal in the second slide (see screenshot belos). One of the advantages of shape buttons over click buttons: they can have custom states, and you can edit the form, needs not to be a rectangle:
- The Text caption is added to show the state of the variable v_attempt. It is part of the debugging workflow, and I forgot to hide it before publishing.
Two user variables are needed:
- v_attempt: has a start value of 0 and will be incremented on each failure (which is a click on the button SB_Backx).
v_hint: will store the text to appear on the Hint message (first failure). Careful: you will need to increase the length of the inserted variable because 50 will not be sufficient in most cases.
FailureAct (Advanced Action)
This action is triggered by the Success event of the shape button SB_Back. The OP preferred to avoid Shared actions. You can assign this action to that shape button on the first slide, but you'll need a duplicate advanced action for each slide, because the color marked items need to be changed:
CleanAct (Advanced Action)
EnterAct (Shared Action)
For the Success situation I just kept the default Success message. This is the Actions tab for the shape button SB_Flags and similar:
Two messages are allowed, Success 'caption' (is a shape) is activated, and the Last Attempt action is set to 'No action'.
The Advanced Interaction panel shows which actions are attached to which events: