Showing Hint with a Delay

Why?

Recently in this thread user asked how to control the appearance of a hint caption.  It was meant to save some frustrations to the learner: hint should appear automatically after some seconds (to be defined), but should not appear when the learner had performed a certain action before that time. This is clearly not possible with the inbuilt Hint messages for interactive buttons. They only appear when the learner is approaching the place where he should click. A custom solution needed to be found. Three solutions were posted, interesting to have a look and compare them. Personally I always bear in mind that someone would like to use this workflow in a fluid boxes responsive project, and that limits the possibilities because stacking is not allowed in normal fluid boxes. We have multistate objects and since a couple of versions a “Delay Next actions….” command.

Example movie

Watch this simple example before reading the explanation:

You will see two slides where a Hint can appear if you are not successful within a delay: slide 2 (arrows) and the Drag&Drop slide (3). I used an almost identical workflow for both slides with a Shared Action triggered with the On Enter Slide event, and a simple advanced action triggered by the arrows (slide 2) or by the object actions (slide 3). Both slides have a hint which is a multistate shape. No variables were used. Slides 4 and 5 show the used actions.

If you prefer to watch the rescalable version, use this link.


Workflow

Hint = multistate object

Both Hints on slides 2-3 are multistate objects. The normal state is the green text bubble, the second state ‘Void’ is completely empty:

On Enter Shared Action

The on Enter action has to perform 4 commands:
  • Hide the Hint shape
  • Wait for a number of seconds
  • Show the Hint shape
  • Apply an effect (I used an emphasize effect).

Only two items needed to be defined as parameters: the Hint shape itself (compulsory parameter) and the literal used for the Delay, to make it possible to have a variable delay if wanted. The Parameter dialog box will look like this:

TIP: although both slides 2 and 3 are pausing at 1,5secs (default pausing point), the command ‘Delay Next Actions by…. ‘ will NOT be paused, timer just continues. That behavior is a big advantage for this particular use case!

Advanced Action ArrowAct

It would have been possible to use a simple action in this case, but the advantage of an advanced action was that I could assign it in one workflow to all the arrows on this slide.

What is the purpose of the Continue command? An advanced action will not release the playhead automatically as is possible with a simple action. On slide 2 a Next button has been added, with a timeline starting after the pausing point of the Arrow shapes acting as buttons. Release of the playhead is necessary to make the Next button visible.

Advanced Action DragAct

Although the advantage of being able to assign the advanced action at once to all the object actions doesn’t exist (could have used a simple action), it was so easy to create a duplicate of the first action that I kept with an advanced action/

It has been assigned to the 4 possible Object Actions in that dialog box, which you find in the Properties panel for the Drop target, under the Format tab. 'Object Actions'.

Drag&Drop Actions

Intro

In the webinar which I presented on 2018/3/15 about Shared Actions, I showed several workflows with shared actions. If you want to have a look at the presentation used during the webinar, look at my previous blog post. You'll find a link to the published interactive movie

One of those examples, was a Drag&Drop slide where both advanced and shared actions were used as Object Actions. It can help you with the tough task to choose between the two types of actions. A similar example appears in the presentation, where only a shared actions was used. It had 7 drag sources and two drop targets:

Example movie

You can watch this movie to understand the goal of the D&D slide. It has 6 drag sources and only one drop target. You will be asked to drag only the correct new features in CP2017 to the drop target. Only when the answer is correct will you see the Next button. There is a Reset button for the D&D, which is not the default reset (because of the states used on the drop target) but uses an approach which I have explained already multiple times.


Setup D&D slide

Auto Submit Correct Answers is activated, and the Submit button has been dragged to the scratch area. The drop target accepts all drag sources, which will disappear behind the target but the count is limited to 3 (because there are 3 correct answers). Due to the Auto Submit which only will happen for the correct answer, the Next button will only appear when the answer is completely correct (Action 'On Success'). 

The drop target is a multistate object. I didn't add InBuilt states in this case but three custom states, using a gradient edited for each state with 'Edit Gradient'.

On the slide, not overlapping with any object, there is a multistate shape, labeled 'Comments',  acting as feedback container. The normal state is blank and you see the other states in this screenshot:

Advanced Action DD_CorrectAct

I imported the shared action used in the presentation to the project Library and used is as a template for this Advanced action DD_CorrectAct. I added the Play Audio command. First I tried to add the audio to the state 'Correct' of the multistate shape 'Comments', but that proved not to work in this case, probably due to the Drag&Drop limitations. After the duration of the audio clip (4secs) the shape reverts back to the Normal state, which is invisible to the user (Alpha and Stroke set to 0).

Sorry for the generic label on he drop target. You probably know from my previous blog posts that renaming an object used in a D&D interaction, will kill the set up. 

Since this action is used with exactly the same feedback text and same audio clip for 3 drag actions it is much better to use an advanced action in the situation. 

Shared Action DD_IncorrectAct

The previously described Advanced action DD_CorrectAct is used as source to create a shared action. Since there is no state change needed for the drop target, the fifth command can be deleted. Five parameters are needed (due to the fact that audio couldn't be embedded in states). Four of them are compulsory parameters, one candidate was turned into a parameter: the literal for the delay time. That delaty time has to be at least as long as the audio clip to be played.

You just need to apply the advanced action and the shared action to the proper object actions: 

Want more?

Goal of this simple example was to show when to use a shared action instead of an advanced action? It could have been done with 3 duplicate advanced actions, which is what I see most clients doing. Start to appreciate the advantages of shared actions over duplicate advanced actions:

  • Ease of transfer to other projects
  • Management in the Library
  • Possibiity to use as template

Give it a try. If you want to learn more, give me some feedback, please.