Dropdown Interaction - tips

Intro

Recently I published some tips about learning interactions, including an explanatory table. The use case in that post showed how to use checkbox and radiobutton interactions. Last week, a user asked a question about the dropdown interaction, which he used for a custom question slide: How can I check if the user has chosen an item? That is not difficult for checkbox and radiobutton, because their associated variable will be empty, but the situation is different for the dropdown interaction, hence this tutorial.
The most common failure that I detect on debugging advanced/shared actions with multiple decisions are due to a wrong understanding of the validation of those actions:
  • all decisions will be checked from left to right
  • there is no way of jumping out of the action when a correct condition is met.
In the use case from the example movie, that sequence behavior is very important!

Dropdown interaction

The properties dialog box is pretty limited:

In this example you see that:
  • entries are separated by commas
  • formatting allows to choose a font, font style and attribute (faux style), but font size is limited to 14pt maximum
  • the color dialog box doesn't show theme colors
  • the update button allows to see a preview of the look after formatting
  • if you want to validate the choice in the list, you need an associated variable (here v_drop); beware: you have to create the variable in the Variables dialog box
  • the first sentence mentions 'combobox' but as I understand the word combobox this is not correct: in a combobox you can not only choose from a list but you can type in a word (there was an older combobox widget), this learning interaction doesn't allow that.
Maybe you are bit puzzled by the first entry 'Choose a language'? Contrary to the radiobutton/checkbox interactions, the variable associated with a dropdown is never empty! By default it has a value equal to the first item in the list. In the example movie, you will see before choosing, and after resetting that v_drop is equal to 'Choose a language'.

Resetting: it is indeed possible since this latest version of Captivate not only to change the value of a variable by an action, but also to have this change reflected in the Display of the interaction. This new feature is used for the Clear button in the example movie.

Beware: for some reason, the first time you use the interaction you will have to click twice, first click to put focus on the interaction, second click to select item. Strange :)

Example Movie

This movie has only 4 slides. After the 'Intro'-slide you can choose a language on slide 'Drop'. Watch the variable v_drop that is visible in a text caption next to the learning interaction. You get 3 attempts to guess the correct language, reason for the variable v_attempts. The 'Drop' slide has two interactive objects: Submit and Clear. Try out Clear to see how the interaction is reset to its initial state. You can click Submit without choosing a language, you can choose a wrong language or the correct one. The third slide you'll only see when your answer is correct. If you exhaust the three attempts without correct result, you will end up at the 4th slide 'Retry', where you are able to get back to the 'Drop' slide and start guessing again.

Variables

Here is a screenshot of the user variables

As explained before v_attempts tracks the number of attempts and starts with value=3, v_drop is the associated variable for the dropdown interaction.

I used v_dummy, a variable containing the text  'Choose a language' out of laziness, to avoid having to type that text over and over again. Be careful: it has to be exactly the text in the first item, it is not possible to use a variable in the item list.

The variable v_groet is used on the third slide, to customize the text based on the current time of the user (cpInfoCurrentHour). The variable v_wrong is a Boolean (value=0) that will be set to 1 when the attempts are exhausted without finding the correct language.

Events and Actions

EnterDrop, triggered On Enter for slide Drop

This standard action resets everything on the second slide 'Drop': the group Gr_Feedback with empty, wrong and correct feedback messages (empty, wrong, correct) is hidden, group Gr_Bt with the two interactive objects made visible, variables v_drop and v_wrong are reset to the default values.

ResetAct, triggered by the Success event of the Clear interactive object

A standard action that restores v_drop to its default value and hides the group Gr_Feedback.

CheckSubmit, triggered by the Success event of the Clear interactive object

This conditional action has 5 decisions, one for each possible situation:
  1. EmptyDone if the user clicked on Submit without making a choice and it was the last attempt
  2. Empty if the user clicked on Submit without making a choice and there are still attempts left
  3. Correct
  4. WrongDone if the user choose a wrong language and it was the last attempt
  5. Wrong if the user choose a wrong language and there are still attempts left

The Sequence is important: if you put Empty before EmptyDone, it goes awry if it is the second attempt, because Empty would have decremented v_attempts and that means that EmptyDone would result also in a True condition, and user will lose an attempt. Same for WrongDone and Wrong, they cannot be switched. 

ExitDrop, triggered by On Exit event of slide Drop

Exceptionally I use the On Exit event, because in this case it will function perfectly. 
A simple conditional action, based on the value of v_wrong.

More...

There is a simple Jump to slide 'Drop' on the last slide. Resetting will happen with EnterDrop action.

The third slide has an On Enter action, to show the right caption based on the system variable cpInfoCurrentHour. 
Do you accept the challenge to figure out that (conditional) action? No need to use my tongue :)

Tips - Learning Interactions

Intro

Captivate 8 has included several learning interactions, that are not well documented in the official Help. You'll be able to download a descriptive table at the end of this article. In the past I have been blogging quite a few times about using Widgets. And there was a similar article 'Using Captivate Widgets? Some tips'. Learning interactions is the name used by Adobe to indicate widgets that are compatible with SWF and HTML5 output, whereas the former Widgets were meant for SWF output. Some of the widgets are still available, others have been replaced by a learning interaction. Widgets can be found in the Gallery\Widgets under the installation folder of Captivate. Learning interactions can be found also in the Gallery, but you'll use them from a duplicate folder in Public Documents, which is easier to access if you don't have full administrative rights. 

In this article I'll offer some general tips. You will see an example movie, using the Radiobutton and Checkbox interactions but I will not explain in depth the advanced actions used for that example. 

Inserting Learning Interactions

There are two possible work flows:

  1. In the Big Button Bar, use the button Interactions, last option. A dialog box with thumbnails of all interactions will be opened. You'll see a badge 'New' or 'Updated' sometimes, when a new version has been pushed to your system.
  2. From the Insert menu, choose Widget and if necessary browse to the appropriate folder. I'm on Win7, you see the folder in top of the screenshot:

The second work flow is also valid for Widgets, and can be used also if you have problems with the Thumbnails dialog box not showing up. I also prefer it because scrolling through a list with names is more efficient than with the other dialog box. Which work flow you prefer, you'll see the the dialog box to edit the properties and parameters for the interaction popping up. In this screenshot you see the dialog box for a simple radiobutton interaction with 2 options (True/False). I unchecked Highlight because that puts a rectangle behind the words 'True' and 'False'. This is one of the interactions that has an associated variable, labeled v_one in this case.


Associated Variables

As you'll see in the table, several interactions have one or more associated variables. In combination with advanced/shared actions this gives you lot of possibilities for using the interactions. You can have a look at the example movie, using both the radiobutton and checkbox interaction. 
As I warned already in the article Tips about widgets, mentioned above, those variables are not created automatically because you type their name in the Properties dialog box, you have to create them in the Variables dialog box as well. The type of the variable is mentioned in the reference table that you can download from the link at the end of this article. 

Example Movie

After the title slide you'll see a slide with 3 Radiobutton interactions to create T/F questions. The Next button triggers a rather complicated conditional advanced action that covers all possible situations:
  • if the user clicks without answering any question
  • if all questions are answered with False (they are mutually exclusive)
  • if more than one answer is True

If you want to test all possibilities you'll have to refresh the browser several times.

I'm using the new possibility to control the display of the radiobuttons, they can now be cleared by controlling the variable.

On the third slide I use the Checkbox interaction, and if you choose the first option (Captivate 8.0.1) on the radiobutton slide, the first option will already be checked for you, another application of controlling the display, in this case using the same user variable for the first T/F radiobutton and the first option of the Checkbox interaction. The advanced action triggered by the Next button will navigate you to another slide, either slide 4 or 5 as you'll find out.

I added a text container with the four user variables v_one...v_four to show how they are changed in the movie.

Resizing - Refresh Widget

When using the interactions Radiobutton, Checkbox, Dropdown and Scrolling Text you'll often need to resize the interaction on the stage to make everything visible. The placeholder on the stage then can look very distorted, discover the Resize Widget button in the Properties that will appear after each resizing to have the placeholder adapt to the new size:


Customizing - Theme colors

All learning interactions can be customized, at least concerning the colors used. New in Captivate 8 is the possibility to have the Theme Colors palette applied to the interactions. I mentioned this already in the article about: Theme Colors. In the table I indicate which interactions do have that new feature. It is not the case for the Checkbox, nor the Radiobutton interaction. You can see the option in this screenshot of a Glossary interaction:


Improvements for Responsive Projects

Some interactions recently got an update to improve the user's experience when used in Responsive projects. You'll also find indication about that in the table. Whenever you see the option 'Scale Text for Responsive Projects'. On the screenshot of the Glossary interaction that option is visible.

Static versus Interactive interactions

In the former Widgets panel, which disappeared in the new UI of Captivate, you could see that widgets existed in three types: Static, Interactive and Question. Interactions have only two types: Static and Interactive. The difference is the same as for the standard objects: an interactive object (shape button, click box, button, Text Entry Box) has events that can trigger an (advanced/shared) a action and can have a score that can be added to the Quiz total. Non-interactive or static objects do not have those two features.

Most learning interactions are Static. Only the Games (with exception of the old Word Search interaction) are Interactive. Beware: although the score for some Games is stored in the associated user variable, you cannot add that score to the Quiz total. The points attributed to a Game in the Reporting section, are granted to the user in the same way as most questions in Captivate (with exception of the MCQ): black-white. If the game has been played, the user will be awarded the points, whatever the score of the game was.

Table - categories

You can download the table here. The categories are my personal choice:

  1. Interactions without variables
    1. Objects: several small interactions
    2. Display: interactions like accordion, tabs... that allow you to show a lot of info on one slide
  2. Interactions with variables: most of my favourites are here like the checkbox, dropdown, radiobutton and scrolling text
  3. Games (with or without variables)

Drag&Drop is to me also an interactive interaction, but because of its importance and different work flow it is not in this table.

Waiting for your comments :)




Custom Short Answer Question

Intro

This is not the first time I publish about creating a Custom Short Answer Question. The default type in Captivate is pretty limited:  the user should enter exactly the same answer as the defined correct answer which is almost impossible with this type of question. The normal validation for such a question is to check if some keywords are present, and eventually if some other keywords have not been used. My previous posts were created with Captivate 5 for publish to SWF only:

Widgets were meant for SWF-output only, including the widget by Jim (this one, he has some widgets that are also compatible with HTML5). Since Captivate 7 the TextArea widget got a companion, the 'Scrolling Text Interaction'. Don't be confused by the name, it is essentially the same widget, but compatible with HMTL5 output. 

This week I accepted another challenge from a Captivate user on the forum, concerning the use of TextArea (or Scrolling Text) with a more complicated condition than the one I described in the previous blog posts: How to verify that a variable "does not contain" a value? As you probably know, the operators in the IF part of a conditional action are bit limited: there is an operator 'contains' but no negative counterpart. My first reaction was to propose the use of JS, but my intuition told me I should also try with advanced actions. This post will explain how I solved that problem, and I was very happy when the King of Javascript in Captivate, Jim Leichliter posted his alternative with JS in the same thread, scroll down to find the script.

In this post I will explain the conditional advanced action, and also point to another well-hidden gem, only in Captivate 8: the Captivate team has now embedded the variable control in the Scrolling Text Interaction! Don't tell that they are not listening to users :) What was only possible with the extended TextArea widget by Jim in previous versions, can be done with the supplied Scrolling Text Interaction.


Challenge

The description of the problem: " We are basically validating the content in the widget and showing appropriate feedback. Since the user can enter anything in the widget, we are only tracking the keywords. To be precise, we are trying to create an Advanced Action like this, where the text entry should contain the words Organizational, Behavioral, and Managerial but not the words Transformation and Non-Compliance. If the entry contains any of the "illegal" words, then incorrect feedback caption should appear."
Translated: when the answer is submitted, the conditional action should show a Positive feedback when:
  • the three first words are included in the text
  • the last two words are not included in the text
If those conditions are not all fulfilled, the Negative feedback should be made visible.
Because of the missing operator 'does not contain' this cannot be done with one decision, one IF combination using AND, which explains why the user was stuck.


Solution 'Divide et Impera' 

After a long career as professor, this has become one of my mottoes: make it simple by splitting up the problem:
  1. Check first if all the conditions are fulfilled and store that result in a Boolean variable. There are a lot of Booleans in Captivate: variables that can have only two values, No/Yes, 0/1, False/True. I will mostly choose for the 0/1 combi. I created a user variable v_TA_OK with a default value of 0 (meaning all conditions are not yet OK)

  2. Show the appropriate feedback based on the value of that Boolean.
This was possible because of the typical way Advanced actions are executed in Captivate: 
  • all statements are executed in sequence and
  • all decisions are executed in sequence
  • the action is not stopped when a positive condition is met

This has led to a conditional advanced action with three decisions.


Movie

Watch this movie, created with Captivate 8, customized theme 'Flat', using custom shape buttons (one is a freeform shape) with three states and the new Scrolling Text Interaction.


Advanced actions - variables

Variables

To make the question more universal, I didn't use literals for the words, but stored them into variables. These variables were created:
  1. v_one, v_two, v_three to store the words (can also be more words in one variable, but they'll have to appear in that sequence) that have to be included in the answer

  2. v_notOne and v_notTwo for the words that are forbidden in the answer 

  3. v_Answer to be associated with the TextArea or Scrolling Text that will store the value typed in the answer

  4. v_TA_OK: the Boolean variable explained above; default value = 0, will only be set to 1 if all conditions result in correct.

  5. v_null: an empty variable that is needed to create conditions for the other advanced actions (as the ones that check if all word fields have been filled); I will not explain those actions here; more info: Where is Null?

Conditional action Check_Short

This action is triggered by the Submit button on the Short Answer slide. This was the answer to the problem presented at the beginning. I will not explain the other advanced actions like the one triggered by the Reset button or the different actions On Enter for slides to reset the situation to normal. The action has 3 decisions:

OKWords

This decision checks if all the imposed words are present in the Short Answer, using the operator 'contains', with AND combination. If that is the case, the Boolean v_TA_OK will be set to 1.

NotOK

The not-allowed words are checked with this decision, using again the operator 'contains' but this time in an OR combination, because even if only one of those words is present, the negative feedback has to appear. If any of the words appears, the Boolean v_TA_OK is reset to 0. It is very important that this check only occurs after the first decision! After this second decision (in this case) all conditions have been evaluated and the Boolean variable v_TA_OK has its final value, will be used in the last decision 

FBack

Only this last decision has also an ELSE part, as you can see in the total view of this conditional action:

As I explained in the last slide of the movie, because of the stack order, where an Interaction always is on top even though it is not on top in the Timeline, I had to hide the Interaction to be able to show the Feedback groups, because they were in the same location. Here is the Timeline of this Short Answer slide:

You see that the Interaction (indication is Widget on timeline) is not on top. The Next button is not on this slide, but on the first slide and timed for the rest of the project. That shape button is hidden/shown when necessary.


Tips

Variables are case sensitive, and contrary to validation of a Text Entry Box it is not possible to get rid of that case sensitivity for variables associated with this interaction. If necessary you'll have to create more decisions.
I wanted to emphasize the importance of sequence by this blog post, and the fact that Captivate will always evaluate all conditions/decisions. This is not always the case in normal programming languages. Trying to explain:
  • The first decision is positive, variable v_TA_OK will be set to 1, but there will not be ending of the condition
  • If the first decision is negative, variable v_TA_OK will remain at 0, no need to include an ELSE part.  This means that the variable can never be set to 1 anymore, but the second decision will nevertheless be checked by CP.
  • If both negative words are not included, nothing happens with the second decision, v_TA_OK will keep its value 1 or 0 depending on the result of the first decision, because there is no ELSE part.
  • If one of both negative words are included, the second decision will reset v_TA_OK to 0, whatever its value was at the end of the first decision
The new possibility in Captivate 8 to change the value of the variable associated with the Scrolling Text Interaction and have this displayed in the interaction is important if you remain on the same slide. Contrary to the extended version of Jim's TextArea widget, the rule that variables for each interaction are cleared when you leave the slide is also applying to the Scrolling Text. If you want to keep value of the variable you have to transfer it to another variable.