Join Pooja Jaisingh for an in-depth discussion in this video Creating a conditional action, part of Captivate 8: Advanced Techniques.
- You will need to create a conditional action in Captivate if you want to perform an action based on a criteria met. Let's create a simple project where we will check the favorite subject of the person and show them the subject slides accordingly. Here, in this project I've created this title slide where I have three buttons for choosing the subject. They go to the next slide where the selected subject is displayed as their favorite subject and then clicking the next button on this slide should take them to the subject that they have chosen.
I've done some pre-work here for you. I've already created a variable, which will record the value of the subject and then I have also created some standard actions. We'll go to Project, Advanced Actions to access them and you can see we have three actions available here. English, Math, and Science. If you select English, you notice that for the English subject, I've assigned subject variable with a literal value of English and then I'm asking him to go to the next slide.
Similarly, for Math, the value is Math and for Science, as you know, the value should be Science. I'll close this and I'll show you where I have assigned these advanced actions. Let me go to English. Double-click it and notice that the On Success action is Execute Advanced Action and the script selected is English. Similarly, for Science, the script is Science, and for Math, it is Math. What you need to do now is to create a conditional action for the Next button where if the subject is English, they should land on the English slide.
If the subject is Math, they should land on the Math slide. Let's go ahead and create that conditional action. To create a conditional action, you'll go to Project, Advanced Action. Here, you will switch the Action Type to Conditional. Let's name the action as Next Button. Here, you will name the decision as English. I'll double-click on Title and rename it as English, so that we know that this is the decision for English language.
Now, let's double-click the first line in IF section. And here for variable, you will select Subject. For the comparison operator, let's go ahead and select is equal to. And then, select literal value and type English. Then, the action should be Jump to Slide English. We'll go ahead and double-click and select Jump to Slide. And here, you will select EnglishLesson.
Now, let's rename the second decision as Science. Now, in the IF section, we'll do the same. We'll double-click, select the variable, and select Subject, comparison operator will be is equal to, and a literal value of Science. Here again, it will be Jump to Slide and the slide will be ScienceLesson. Let's do the same for Math.
Now with these three decisions created, let's go ahead and save this action. I'll go and click Save as action and click OK. Now let's close the Advanced Actions dialogue. Let's go ahead and assign this action to the Next button on second slide. We'll go to the On Success criteria under the Properties Inspector, Actions tab. Select Execute Advanced Action. Here, make sure you select the Next Button script.
Now let's check it out. We'll go to Preview, Project. Let's go ahead and select Science and it says, Looks like Science is your favorite subject. Click Next to begin. When I click Next, it takes me directly to the science lesson. Let's click Next again and it takes me back to this page. I click English and this time it takes me to the English Lesson.
- Introducing actions, events, and variables
- Creating advanced actions
- Working with lightboxes
- Creating custom navigation
- Controlling audio through screens
- Building custom themes
- Inserting smart shapes
- Making elearning projects responsive
- Creating advanced quizzes
- Converting text to speech
- Being more productive in Captivate