Recently, a community member posed an interesting design challenge.  She wanted the learner to choose whether or not audio would play in the course.  Not only that, but the course navigation should also change based upon that choice.  If the learner chooses to have the audio play, then the slides should advance automatically.  If the learner chooses to read the notes (and have no audio play), then the slides should only advance when the user clicks the next button.  This is a great idea as it allows the learner to sculpt their course experience. To accomplish this, we can leverage a true/false variable in Storyline.

Using a True/False Variable in Storyline

I like to think of variables as assistants in my course. These assistants help Storyline keep track of certain types of information ("Hey, text variable, what did the learner type into that text box?" and  "Hey number variable, how many times has the learner clicked that button?").  What's great is that my assistants have great recall, so I can always ask them for that information and then use it to influence events during a course (like showing a certain layer when the learner clicks a particular button for the fourth time).

A true/false variable helps Storyline to understand whether it should execute a particular action. “True(yes), this particular action should happen” or “False (no), this particular action should not happen”.  Whenever I use a true/false variable, I like to think of the variable in terms of what it's keeping track of (I find this a great way to conceptualize it's function).  In the case posed by our community member, my true/false assistant is going to keep track of whether the learner wants the audio to play or not.  So I would think “True, the audio should play” or “False, the audio should not play”.  Now, programming purists will no doubt scoff at my mental model, but I find it a helpful way to conceptualize how variables work.  Speaking of which, let's put a variable to work right now to solve our community member's design challenge!

Step 1: Add a True/False Variable

Click on the variables icon and add a true/false variable.  Keeping with the theme of thinking of the variables in terms of their actions, I also like to name my variables in a similar manner.  So in this instance, I might name my true/false variable something like “audioshouldplay”.  This not only creates a means of quickly identifying variables in a course, but it’s also intuitive. Since it’s a true/false variable, I can now think to myself “audioshouldplay” true, or false?  

Step 2: Add a Choice Mechanism

With the variable created, our next step is to add a means for the learner to choose whether they wish for the audio to play.  An easy way to do this is to present them with a choice at the beginning of the course.  A simple screen with two buttons and a description of the consequences of each choice would do the trick.  Choice 1:  Have audio play and slides advance automatically.  Choice 2: Read the notes without audio and use the next button to advance.

Step 3: Add Triggers to Toggle the Variable

So we have our buttons, but now we need to connect them to our variable.  To do so, we’ll create a trigger for the “Choice 1: Have audio play” button that adjusts the true/false variable to “true” when that button is clicked.  You’ll create a similar trigger for the “Choice 2: Read the notes” button option that adjusts the variable to “false” when that button is clicked.

  

Important Note: At this point, it can be tempting to think that the variable is now controlling the audio.  However, that’s not yet the case.  What we’ve done thus far is the equivalent of creating a light switch.  We can flip it on and off (“audioshouldplay” true and “audioshouldplay” false), but it isn’t going to cause anything to happen.  Why?  Because it’s not connected to anything yet. It’s just a pretty cool light switch with dangling wires.  Our next step is to wire it up to our audio.

Step 4: Target Audio Files with a Trigger

Let’s proceed to your first slide that has audio (if you haven’t done so, please add your audio).

You’ll notice that when you place an audio file on the timeline, you can see it’s waveform.  This is an indicator that the audio is going to automatically play when this slide is reached.  However, we don’t want this to happen.  Remember, we only want the audio to play if the learner has made that choice.

So we’re going to tell Storyline to only play the audio file if the “audioshouldplay” variable is equal to true.  So we add this trigger:

Now as you add your trigger, watch how the audio in the timeline changes:

The reason the visual state of the audio on the timeline changes is because we’ve “targeted” it with a trigger. By doing so, we’ve placed the audio clip in standby mode. It’s no longer going to automatically play when the slide is reached.  It’s waiting for an instruction. And our trigger (the instruction) says to only play the audio file if the “audioshouldplay” variable is equal to true.  So if the learner chose “Choice 1: Have audio play”, the variable will be equal to “true”, and the audio will play.  But if the learner chose “Choice 2: Read the notes”, then the “audioshouldplay” variable was switched to false and the audio won’t play.

Congratulations, you’ve just “wired” your variable to the audio file!  Now repeat this process for every slide that has audio.

Step 5: Control Slide Advancement with a Trigger

Now that we have our audio wired, we need to alter the navigation. The default setting in Storyline is to advance to the next slide when the user clicks the “Next” button.  This is perfect as it meets the criteria for our “Choice 2: Read the Notes” option.  So, all we have to do is tell Storyline what to do if the audio is playing.  One simple trigger does the trick.   We tell Storyline to jump to the next slide when the audio on that slide finishes playing.

So Storyline will only automatically jump to the next slide if the audio has finished playing (and remember, the audio won’t play if the “audioshouldplay” variable is equal to false).  So do this on each slide where you have audio and the new navigation scheme is set.

Super Awesome Bonus Tip:

Let’s say that you want the learner to be able to change their mind about the audio and navigation throughout the course.  Not a problem.  You could easily add a set of buttons on the slide master that “toggles” or switches the “audioshouldplay” variable between true and false.  Now the learner can alter their choice on a slide by slide basis.  Awesome!

If you’d like to see me walk through the process that I described above, watch this Screenr:

 

If you want to try this yourself but don't have Storyline, no problem. Just sign up for a fully functional, free trial. And don't forget to post your questions and comments in the forums! We're here to help. For more e-learning tips, examples, and downloads, follow us on Twitter.

27 Comments
Mike Enders
Mike Enders
Payal Tandon
Mike Enders

Hi Payal, Thank you for the kind words! You can certainly do as Mark suggests. You'd set up a true false variable, have both language audio files on the slide and then create triggers to play the correct audio based upon the state of that variable. On it's face, it's a relatively simple approach. The largest caveat that I can think of has to do with the issue you mention (differences in audio length). The challenge comes in if you have animations timed to the audio. There's no simple means of having a bullet fade in at the 7 second mark in English, but at the 9 second mark instead if the Spanish audio is chosen. In this case, one might explore the possibility of having the English content on one layer and the Spanish on another and then use a trigger on the base layer to play... Expand

Carol Snider

I am doing something similar, except with video instead of audio. My main menu screen begins with an intro video, with seven branching choices. The user comes back to this screen often throughout the training and I don't want the video to automatically play upon repeat visits... but I do want the learner to be able to choose to re-watch the video (and to stop it, as desired). Everything above sounds like it would work for me, except for one problem: unlike an audio, a video has its own embedded PLAY button, which I want the learner to be able to access and control upon return to this screen. (Upon initial visit, the video would begin to play automatically, but the learner could stop it and re-start it.) How would I achieve this? Thanks in advance! (And I sure hope this thread has... Expand

cecilia Alegro
Mike Enders

Hi Cecilia, You can certainly add your toggle button to the slide master (and add a trigger there as well to toggle the True False variable). But on the slide level, you'll still need to target the individual audio files on each slide as there's no global way to silence audio in a course. In your case (if I'm reading it right), you could have a trigger to pause the audio when the slide starts (the idea in the article) and then add another trigger to pause the audio when the variable changes. This would allow the learner to pause the audio immediately on the slide itself. Of course, if you also want to give the learner the ability to restart the audio after pausing it, then you'd need another trigger to play the media when the variable changes. But keep in mind that if you have a... Expand

J.C. Chang