Scenario: You need to provide a way for learners to jump from any part of the course content to another section where help information or course instructions are provided. But after looking at any number of slides within that section, you need users to be able to jump back to their original departure slide again to resume their course navigation.
How can you make Adobe Captivate remember where the user navigated away from the main content, even after they've visited several other slides in a separate content area?
Techniques required for this interaction
You need to capture the number or label of the slide where the learner departs the course, save the location of that slide to a user variable, and then use this value as the target when the time comes for the learner to jump back to the same departure slide again. To solve this tricky navigation problem we’ll be using the system variable cpInfoCurrentSlide and another special command system variable called cpCmndGotoSlide.
- Go to Project > Variables and create a user variable called TargetSlideIndex or similar.
Capturing the current slide index number as a target
- On any slide where you want the user to jump to a different section and later resume where they left off place a clickable object that executes a standard action that does as follows:
- Assign TargetSlideIndex with the value of the cpInfoCurrentSlide system variable.
- Jump to the intended slide (e.g. a Help or Course Instructions slide).
For example, the standard action shown below could be executed by a slide button object.
- To illustrate how this works I’ve set up an example project file with five topic slides followed by three slides for course instructions. I’ve placed a button at the top of each topic slide to jump to the Course Instructions. This button executes the JumpToCourseInstructions action shown above that captures the current slide number before jumping the user to the first slide in the course instructions section.
In the example project I’ve also added a couple of text captions with inserted variables so that you can see how the current slide index and the target slide indexes change.
Setting up the action to return to the target slide
- Create a standard action called JumpToTargetSlide, and assign actions as shown below:
- Expression – cpCmndGotoSlide = TargetSlideIndex – 1
You may notice in the screenshot above that I’ve used an Expression action here instead of an Assign action, and that the expression is subtracting a value of 1 from the TargetSlideIndex variable before using it to set cpCmndGotoSlide.
The reason for this seemingly bizarre choice is that Captivate’s slide number index is out by a value of 1. The end result of this is that if we just use the exact value of cpInfoCurrentSlide as our target slide index we’d end up on the slide immediately after the one we want to jump to.
So, since an Assign action doesn’t allow me to do math subtraction, I’ve had to resort to using an Expression action to subtract 1 from the value of TargetSlideIndex so that we actually end up going to the correct target slide.
- In my example project, each Course Instruction slide has a button at the top (see screenshot below) that executes the JumpToTargetSlide action, thereby allowing the user to return to their previous slide location in the course content, even if they visit more than one slide in the course instructions.
How does all this work?
Unlike browser Back buttons, there is no History array in a Captivate project that records all of the slides visited by the learner and in what order.
There’s a system variable called cpInfoLastSlideVisited which stores the number of the last slide the user visited before the current slide. However, this provides no solution for our specific scenario since it only allows the user to jump back one slide, whereas we need to allow the learner to visit several other slides before returning to the content section again.
The same goes for using the Go To Last Visited Slide action. It only jumps back one slide, and you can only use it once. After that, Captivate doesn’t remember any further history.
The solution explained above captures the number of the slide the user is currently viewing (known as the slide index) from the cpInfoCurrentSlide system variable and stores this in the TargetSlideIndex user variable. No matter how many other slides the user visits after this, when the time comes to resume viewing content slides, the JumpToTargetSlide advanced action jumps the user.
A word about cpCmnd system variables
The cpCmnd group of system variables are something of a special case. Most system variables just hold or display a value and nothing more. However, when you assign a value to a cpCmnd variable it uses the assigned variable to do something, i.e. execute an action. In the JumpToTargetSlide standard action shown above, we’ve used an Expression action to assign the cpCmndGotoSlide system variable with the value of the user variable that will be storing the location of a target slide. The result is that executing this standard action causes the user to be jumped to the location of the target slide index stored in the variable.
Captivate 5 has six cpCmnd and seven rdCmnd system variables. The letters rd in rdCmnd variables stand for RoboDemo, Captivate’s predecessor. But in later Captivate versions all rd variables have been deprecated and replaced with equivalent cp variables. For example, Captivate 7 now has fourteen cpCmnd system variables. You’ll find them documented in the Appendix for system variables at the end of the Guide to Adobe Captivate Advanced Actions e-book. Get to know these system variables well. They come in very handy!
If you liked this topic, you'll also like these...
- Limit interactive objects to a single use
Learn how to disable a button after it has been clicked once, or disable a Text-entry Box after a user has entered information.
- Dynamically enable or disable interactive objects based on user variables
This is a great technique that can be used in learning games.
- Show visual feedback for disabled interactive objects
Learn how to set up visual feedback mechanisms so that learners are clued into which interactive objects are available for use and which ones are currently inactive.