Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

September 7, 2018

Storyline Tutorial: Counting Answers

Sometimes we want to make sure that users attempt an interaction or select the right amount of options. While such mechanics alone are not helpful in ensuring that "people learn", they are great if you want to customise feedback or course content, or if just prevent accidental errors and attention slips.

While Storyline makes it easy to check if the user selected all, one or none of the options, when it comes to n-amount of answers out of many, things get a bit more complicated. In the following example, we'll solve this problem by creating a simple interaction that will count the amount of answers selected and will warn the users if they have selected too few or too many. In this case, the users will have 6 options to choose from and they need to select exactly 3. You can see the finished example here. 

I've created a Storyline 360 file to get you started (download it here). But if you wish, you can follow this tutorial in your own. Here are the elements you'll need:

  • Objects to choose from (make sure they have the "Selected" state)
  • Submit button (either your own or the one in the player).
  • Layer with feedback for less than 3 answers selected
  • Layer with feedback for more than 3 answers selected


With the set up out of the way, time to add some interactivity. First, create a number variable "AnswersSelected". As the name suggests, it will be used to track the number of answers selected.

Then, select the object "Option 1" (if you're using the tutorial file) or any interactive object (if you're working in your own project) and create the following trigger:




At this point you can add a text box with the variable reference to the slide and preview the slide to check if the trigger is working:

1 is the value of AnswersSelected variable.

If it is working and the variable value is changing with the object state, go ahead and copy this trigger to all other objects. As you paste the trigger, you will notice that all trigger references to "Option 1" automatically change to "Option 2", "Option 3" and so on - depending on which object you are pasting the trigger to. As you can see, copy/pasting triggers can save heaps of time (but only if you make sure the trigger works before copying it).

As you have most likely noticed, at this point the value of the AnswersSelected variable will increase each time an object is selected. So, if you select and de-select the option "Bacon" three times, the course will think that you have selected three answers. So, we need to find a way to track when an answer is de-selected.

These are definitely not the results we are looking for...

Since we add 1 to the variable value whenever an object is selected, we will create trigger that substracts 1 if the same object is de-selected. To achieve that, create the following trigger:


Now, preview the slide once again and verify that the variable value changes correctly when you select and de-select the same object. If it is working (and it should), copy it over to other objects.

With all triggers added, preview the slide once again and check if the variable value changes correctly. At this point it should, but in general, I recommend verifying your work often, so that you can pick up any issues early on and therefore troubleshoot them easier.

Although it is clear that bacon is the only choice that matters!

For the final touches, create a trigger to show feedback for less than 3 answers selected:



Then, copy/paste this trigger and change the name of the layer and the value of the variable to show feedback for more than 3 selected answers.

Finally, create a trigger to allow the user to continue if they selected exactly 3 answers:



And that's all there is to it - preview your work and enjoy!

July 2, 2017

Building Games in Storyline: River Crossing Puzzle

E-learning Heroes Challenge #173 is all about brain teasers: not only do users get to solve some puzzles, but you, the developer, have something to think about. For this challenge I decided to recreate one of the river crossing puzzles, where you need to move three things across the river: the wolf, the sheep, and the cabbage. There is space only for one cargo item on the boat. Naturally, when left alone, the wolf will eat the sheep and the sheep will eat the cabbage. You can see my version of it here.

In this tutorial I will focus on creating the interaction and will omit the decorations, such as the moving water and clouds, animated boat, or the design of  the feedback slides. However, if you'd like to hear more about these topics - let me know. The tutorial assumes that you know the interface of the Storyline and know how to start creating basic triggers, variables and states.

The Assets

If you want to use the same assets as I did, you can download the exact images here. Please note that these images are designed by Freepik. You can download the originals as follows:

The Project

Before we begin, let's take a look at our final goal. Not counting the title slide, this project is using four slides in total. Two slides are "end slides", which the user will see in case either the sheep or the cabbage got eaten. The other two are the river shores.

The slides used in this challenge

There's a saying in Russian that "laziness is the driver of progress" and I tend to wholeheartedly agree. As you notice, I did not (and usually do not) build slides for each possible combination of animals on each shore. I know some Storyline users tend to do that, saying that it is easier than dealing with cumbersome variables. While this is true in some cases, looking back at the projects I built, in most situations I don't find this easier or more helpful than working with variables. Instead of keeping track of all this information myself, I prefer to give instructions to Storyline and let it do all the hard work. See? Laziness in action. I hope this tutorial will help you embrace your inner sloth and find ways to do less work in Storyline.

Create the Slides

Go ahead and create three slides:
  • Shore 1
  • Sheep Eaten
  • Cabbage Eaten

Note that we are not creating the slide "Shore 2" yet - this is intended.

Leave the "Shore 1" empty for now and put some text on the "Eaten" slides, so that you know which one is which when you test-run the project. You can, of course, design them a bit more, if you wish.

Create Variables

We have three items (the wolf, the cabbage, and the sheep), two shores and two possible tragic outcomes. In other words, we need to know where our cargo is (in shore 1, shore 2 or in transit on the boat) and if it's still faring well.

Let's start by creating several True/False variables, as shown below:

List of variables you will need

Since you begin with all the items on Shore1,  set the variables for Shore1 to "True" and variables to Shore2 as "False". Since the cabbage and the sheep are not dead, set the variables for tracking their vital signs to "False".

Build Shore1: Objects and States

For the sake of brevity, I will refer to the wolf, the sheep and the cabbage as "animals" (sorry, cabbage!). Speaking of which, in addition to the obvious objects, such as a boat and the animals, you will also need to create the following:
  • a shape for the cargo hold (this is what makes the animal "appear" on the ship)
  • a "Submit" button (this submits the user's choice and triggers the navigation to the other slides)
Important objects on Shore 1

You can create the "Submit" button in any shape or format or even use the button in a player. In my example I'm using a hotspot positioned over the ship. Go ahead and create your "Submit" button in any shape you desire.

In my example, the users needs to click on the animals to move them to or from the boat. What happens in Storyline is that when the user clicks one of the animals, the state of the shape "Cargo" changes it's state to match the selected animal. The state of the selected animal changes as well. Let's build this.

Format the "Cargo" shape to have no fill and no outline. Then create a new state called, let's say, "Cabbage" and add a picture of the cabbage to it. You can also add a brief "Fade" animation to this picture. Repeat this for the states "Sheep" and "Wolf". This is what you should have in the end:

States of the "Cargo" shape.

Create states for the animals. In my examples I've created the "Hover", "Selected" and "Disabled" states. You can omit the "Hover" and "Disabled" state, if you like, the important part is to have the "Selected" state. For the ease of following this tutorial, I recommend including the "Disabled" state as well (otherwise you will need to use "Hidden" state in all triggers that use the "Disabled" state).

"Selected" and "Disabled" states should be empty. To achieve this, simply delete the image of the animal from the state, while in the "Edit states" mode.

This is how the states of animals should look like.


Note: make sure that you're using the built-in states and not creating custom states that you name "Hover", "Selected", etc.


Shore 1: Loading the Animals (Triggers and Variables)

Time to make all of the objects interactive. What we're trying to achieve is the following:

  • When an animal on the shore is clicked, the state of the "Cargo" should change and the variable "XonShore1" (X is the name of the animal) should change to "False"
  • When an animal in cargo is clicked, the state of the animal on the shore and the state of Cargo should change, and the variable "XonShore1" should become "True".


First, select all three animals and add them to the Button Set. Then, select and animal (e.g. wolf) and create the following two triggers:

Repeat for each animal

Add similar triggers to the sheep and the cabbage. Preview your slide - it should look like this:

Animals are moving into cargo

Now we can load the animals, but we also need to have an option to unload them, without picking up a new passenger. Essentially, what should happen, is that the state of the animal on the shore should change from "Selected" to "Normal", when the user clicks the animal in the "Cargo". Which animal's state will change will depend on which animal is currently standing on this ship. In addition, we need to adjust the variable "Animal on Shore 1" to "True".

Click on the "Cargo" and create the trigger to make the animal in cargo appear on the shore (I'm starting with a wolf in this example):

The state of the Wolf will change if the Wolf is in Cargo.

Next, create a trigger to adjust the variable "WolfonShore1" to "True" when the user clicks the Wolf in Cargo:

Don't forget the condition.

Repeat the same for the remaining animals. In the end, the list of triggers for object "Cargo" should look like this:

Two triggers for each animal.


Finally, add a trigger to change the state of the Cargo itself:

Very easy

Make sure that this trigger appears at the end of the triggers associated with the object "Cargo". You can add conditions here (such as "If state of 'Cargo' is not 'Normal'") but they are not particularly necessary.

When I work with variables, I often add a text box with the variable references to the slide, to have a clear visual indicator that they change correctly. For example:

These can be found in Insert > Reference menu in Storyline 2


Preview the slide and try to load and unload the animals. You should see something like this:




As you see, the variables are not always changing correctly. If I click on the sheep while the wolf is in cargo, the variable "WolfOnShore1" will remain false, even though the wolf is on the shore (this is also true for other animals). Let's fix this.

We need a trigger that starts when the user clicks on an animal on the shore while another animal is staying in cargo. Select the wolf and add the following trigger:

Is the sheep in cargo? Then it will be moved to the shore if we click another animal.

Add the similar trigger to the wolf, but this time with the cabbage. When you're done, take a look at the list of triggers associated with the wolf. If you've been following this tutorial exactly, you will note that one of the triggers - "Change State of Cargo to "Wolf" when the user clicks" - is located somewhere at the top of the list. Move this trigger to the very bottom, so that all variables get adjusted before Cargo changes it's state:



Repeat for other animals. In the end, the animals should have the following triggers associated with them:

Note the order of triggers.


Preview the slide once again - the variables should adjust correctly no matter where and how you click. At any time, there should be only one "false" variable, as at this point only one animal can be on the boat (not on the shore).

Shore 1: Set Sail

With the loading and unloading taking care of, it's time to turn our attention to the "Submit" object we created earlier and add the navigational triggers.

This is a relatively easy part, as we will need to achieve the following:

  • Show user the "Sheep Eaten" slide, if the wolf and the sheep are on the same shore
  • Show user the "Cabbage Eaten" slide, if the sheep and cabbage are on the same shore
  • Show user the "Shore 2" slide, if both the sheep and the cabbage are safe.

Create the following triggers for the "Submit" object:



The point of this is to, firstly, verify if either the Sheep or the Cabbage are "dead" and then navigate the users to the appropriate slide, depending on what happened.

Note that since at this point we don't have the slide for Shore 2 yet, I used "jump to next slide" option as a placeholder. We will correct this in a moment. Also, don't forget to use "AND" in this trigger - the user should proceed only if both objects are safe.

Building Shore 2: Setting the base

Duplicate the slide "Shore 1" and rename it to "Shore 2". Go back to "Shore 1" and update the "jump to next slide" trigger I mentioned earlier, so that it points to "Shore 2" instead. 

Now, go through the list of all triggers on slide "Shore 2" and change anything that contains "Shore 1" in its name to the matching variable named "Shore 2" instead. For example, if you have a trigger that adjust variable "SheepOnShore1", change the variable to "SheepOnShore2", without changing anything else. It's a bit of a slog, but better than writing from scratch. Once you're done, preview the slide and check that variables for Shore 2 are changing appropriately (note that you will start with them as "False" at this stage - this is intended.

Shore 2: Reflecting the Reality

At this stage, when you preview "Shore 2", you will see all animals on the shore, even though they shouldn't be there. Let's change that and add these three slide triggers to disable the animals, when they are not on Shore 2:



In addition, we need to make sure that the user can see the correct animal on the ship. You may remember that when an animal is on the ship, it is, in terms of variable values, neither on Shore 1 nor Shore 2. In other words, if both these variables are "False", the animal is in the cargo. Let's add slide-level triggers to reflect that:



To check if everything works, preview the whole scene and click around.

Back to Shore 1

In your preview you may have noticed that if you sail back to Shore 1, it will not show you the correct status of pretty much anything. Let's fix that. 

First, adjust the slide properties for Shore 1 and Shore 2 to "reset to initial state". Then, go back to slide "Shore 1" and add the same triggers that we created previously for "Shore 2", but this time replace all variables with the ones that are relevant for "Shore 1". Essentially, you can simply copy the 6 triggers we created in the previous steps from "Shore 2" to "Shore 1" and make necessary adjustments. In the end, you should have the following Slide Triggers on "Shore 1":




Final Feedback

Finally, let's go back to Shore 2 and add an option to let the user know that the task was completed. In my example, I used a layer that appears when the last animal have been moved to the shore. 

Go ahead and create a layer with the matching message. In layer properties, select the option to "Prevent the user from clicking on the base layer". Then go back to the main layer, select "Cargo" shape, and add the following trigger to it: 



Preview your project and enjoy the ride - you have built your own river crossing puzzle. If something is not working, you can download the Storyline 2 file used in this tutorial from here.


Questions? Comments? Anything missing or can be done better? Let me know in the comments or connect on LinkedIn.


October 9, 2016

Creating Adaptive Menu in Storyline

I have always been fascinated by the idea of learning objects and adaptive learning systems. This interest is partially selfish - as a learner I rebel against training materials that force me to click through every single thing on every single slide, without letting me skip anything that I might not need, or already know.

For this week's ELH Challenge, I decided to approach the topic of checklists from my favorite perspective of adaptability. In my concept demo, I am assuming an e-learning module with three chapters.  I included three questions, which represent a pre-test on the training content. Based on the results of each asessment, the module chapters are shown as "mastered", "suggested for review" or highlighted as "focus points" for learning.

Animated menu

In this post I will explain how the concept was created in the Storyline 2. However,  the biggest challenge of this concept (assuming you would like to flesh it out) is not the development of the list, but the instructional design. Mostly because you will need to create a good assessment that will actually measure the learner's knowledge of the subject matter. Note that you will need to have as many sets of questions as you will have chapters in your e-learning.

I will assume that you are not aiming to report the results of this pre-assessment to the LMS or otherwise track it, as it's not an intended purpose of this interaction.

Creating Assessment 

There are two ways to implement the assessment:

The former will give you more control, the latter will save time.

If you wish to draw questions randomly, divide them into questions banks (one bank per chapter) and add random draws from question banks to your project. It is interesting to note that you can add any slide to the question bank. You don't have to use the built-in question slides or freeform interactions.

If you're not using your own variables, you will also need to create a separate scene and add three blank results slides - one slide per each set of questions. Essentially, you're aiming for this:


It doesn't matter how your slide results look, since they will not be visited by learners - this is the reason they are in a separate scene. The only reason we need them is to have the quiz result variables. Specifically, we'll be interested in ResultsX.ScorePercent or ResultsX.ScorePoints - depending on whether you want to use percentage or points for the final scoring.

Creating the Menu

Fancy Checkboxes

You will notice that self-ticking checkboxes are animated. To recreate this, first, create three separate objects: a "Normal" checkbox, a "Filled" checkbox, and a Check Mark. Note that I used a regular shape rather than a button.

Create a custom state for "Normal" checkbox - let's call it "Checked".
Add desired animations to the "Filled" checkbox and the Check Mark. Select both of these objects, cut (Ctrl+X) and paste them into the "Checked" state of the "Normal" checkbox. In other words, you'll have three objects inside an object:
Check box state using two additional objects.

Don't forget to create three custom states to signal the chapter status, for example:
Custom states of the "Chapter status" label

I used "Shape" animation for the filled checkbox, "Grow" for the check mark, and "Wipe" for the chapter status labels. I do recommend using animations for elements that need to turn from invisible into one of several possible states (such as chapter status labels in this example). Otherwise before changing to the custom state, they will flicker the "Normal" state for a second. Adding even a tiny bit of "Fade" solves this issue. Of course, you can try to create a "normal" state that is invisible, but consider animations, too.

Create the rest of the objects and adjust their positions on the timeline, as you wish. In my example, I have arranged everything as follows:
The elements of one chapter (title, background, status, checkbox) are grouped together and arranged on the timeline. The group is then copied to preserve the timings.

To save time, I would recommend creating the elements for the first chapter "card", add animations, timeline positions, etc. Then group the elements and copy/paste the group as many times as you have chapters. This way you will keep all properties and timeline positions of all the elements within a group - no need to adjust each of the elements over and over.

This is the way I created the "spinner" on the "Processing results" slide: I created and timed a group of 4 circles, grouped them and pasted the group several times on top of itself.

Triggers

Finally, create the triggers to change the states of checkboxes and  chapter status labels, based on the assessment results. For example:
The checkbox will be set to status "Completed" if the learner scores 85% or more on the first assessment.
You're done!

Not Visiting Results Slides?

Yes, you don't actually have to visit the results slide to generate the quiz results. You can, if you like, create a "Loading screen" slide and add the "Submit quiz results" trigger to it (it will work for more than one assessment):



While I haven't tested this concept on an LMS, I haven't had any issues with the menu items changing states with the described setup when viewing the published output online. As I mentioned before, the ability to report these results was not intended for this interaction, but if you need to report these results, feel free to experiment with the results slides or any other workarounds and let me know what you find out.

July 15, 2016

Creating a Badge Interaction in Storyline 2

In this post I will walk you through the creation of this badge interaction in Storyline 2, which was a part of my submission for this ELH Challenge. Please see my previous post for more background and context for this interaction.

This tutorial is quite detailed, however, it assumes that you are familiar with the interface, tool names, and know how to create variables, objects and states. By the end of this tutorial you will create 4 slides: three slides for badge creation and one for badge overview.

Step 1: Create the first slide

Create a blank slide with the background color of your choice. Since we will be using animated transition in this interaction, I recommend using a simple solid-color background.

Step 2: Start the badge 

Start by creating a blank badge on the first slide. You can use a "Rounded Rectangle" shape and fill it with the color of your choice or the color of actual badges if such are used within your company. In my example I'm using #F3F3F3 color for both fill and the outline.

Add the text box with the question "What's your avatar?" Adjust the text size and properties as you desire. In this example, I'm using Open Sans, size 44, text color #C45500 and the text box has the same width as the badge.

Make sure that your badge shape extends slightly beyond the slide on the bottom. It doesn't matter how far it goes, as long as it extends beyond slide limits:


While you can adjust the image to the bottom of the slide, so nothing spills over, but I prefer making shapes larger than the slide to make sure that there are no gaps or surprises later on when we'll add the slide transition.

Optional detail

To create a lanyard hole in your badge:
  • Draw a small rounded rectangle shape and adjust the rounded corners to maximum.
  • Fill the shape with the background color (use Eyedropper if you didn't save the color in the palette).
  • Add an inner shadow to the shape. In this example I'm using "inside top" shadow, as I'm assuming that my light source is at the top of the screen. 

Step 3: Copy and adjust the badge

Duplicate Slide 1 to create Slide 2. Delete the lanyard hole if you created one and change the question text to "What's your name?". Then adjust the height of the badge so that it extends beyond the slide borders on both top and bottom:


Don't forget to adjust the position of the text box. For example, you can use these position settings:


When you're done, duplicate Slide 2 to create Slide 3. All you need to do here is to change the text of the question and drag the bottom of the badge up so that that the shape extends beyond the top slide border only:


Step 4: Set up transitions

Select all three slides and add the Push / From Bottom transition to them (note that if you're working on a real project, you may want to change the slide transition for the very first slide, depending on what type of slide or interaction precedes it). This way you will achieve the effect of the badge moving/scrolling as if before the user's eyes.

You can preview the project at this stage to check if everything works well. The transition should be smooth and the badge should not "jump":


Step 5: Photo selector - create objects

Go back to Slide 1 and create the following objects (feel free to adjust these to your needs or design):
  • Background for the avatar.
  • Two buttons or shapes for paging between the avatars. Note that both of them should have a "Disabled" state. 
  • Button to save the avatar.
  • An avatar with as many different states as you like. 

Objects on Slide 1

For making your life easier later on, I recommend naming the states with numbers, starting with 0. As a result, you will have a "normal" state, state 0, which is a duplicate of "Normal" and as many additional states as you need:


Why? This is because of the triggers and variables we're going to use later as you will need to match the state names with numerical variable values and matching state names will help you avoid confusion. If you feel that what I just said doesn't make sense, don't worry - just try creating and naming the avatar states as you see on the screenshot above and you'll see the system behind this madness later, I promise! For the rest of the tutorial I will assume that the amount and names of your avatar states match the ones on the screenshot.

With the avatar states created, set its initial state to "0".
If you're wondering why I am using avatar states rather than creating separate objects - in my opinion, states reduce visual clutter on the slide and often reduce the need for triggers. When a trigger changes an object's state, all other states become invisible, without any additional efforts on your side. If instead of 10 states you have 10 objects, you will most likely have to write either more or more complex triggers to manage their visibility and states. 

Step 6: Photo selector - create variables

With your objects created and arranged, create the following numerical variables:
  • ClickCounter (default value 0): to enable/disable avatar selection arrows and help Storyline understand which avatar state it should be displaying.
  • AvatarSelected (default value 0): to store the information about the selected avatar for further use throughout the course.

Step 7: Photo selector - create triggers

By now we have prepared all our objects and variables. Now we're going to bring them to life. Our end goal for the photo selector is to ensure that the user can page back and forth between the avatars and that the avatar selection arrows become disabled when the user reaches the end of the avatar selection. 

In case you haven't done so, name one of the buttons "PhotoNext" and the other "PhotoBack" to avoid confusion. Change the initial state of PhotoBack to "Disabled".

Create the following trigger for PhotoNext:


And a similar trigger for PhotoBack, except in this case we will be reducing the ClickCounter value by one:


This way we can tell the course what the user is doing with the buttons and which avatar should be displayed.

Next, let's add a trigger to change the state of the avatar based on the value of the ClickCounter variable - this is where avatar state naming becomes handy!


Repeat this for each state of the avatar you have, except state Normal which we don't count in this case:

As you've probably noticed, the creation of triggers is easy because the state names are identical to the values of clicks. In other words, if the ClickValue is 5, Storyline should display avatar state 5, if the value is 3 - state 3 and so on. This way you can have as many states as you want without losing track of what should happen. Way better than naming your states "Male01" or "FemaleYoung-10-happy".

At this stage you can preview the slide to admire your work. If everything worked well, you will be able to flip through the avatars, but you won't be able to go back, since we set the PhotoBack button to appear disabled from the start and didn't create any triggers to enable it. You'll also notice that there's no limit to how much you can click PhotoNext button. Let's correct that.

Step 8: Photo selector - create intelligent buttons

In essence, we need to enable PhotoBack button as soon as the user navigates away from Avatar 0 but disable it back when the user returns to Avatar 0. Similarly, we need to disable PhotoNext button once the user has seen the last avatar in the series and enable it once the user goes away from the last avatar. 

Let's create triggers for PhotoBack button. This trigger enables it: 


And this trigger will disables it again:


As a small challenge for you, I won't include instructions for creating triggers for enabling/disabling PhotoNext button, but I can tell you that they are pretty similar.

Step 9: Photo selector - sanity check

Create a text box anywhere on the slide and add text %ClickCounter% to it. Alternatively, you can use the option Insert / Reference. Don't worry about formatting or position, this is just a way to verify that the value of clicks matches the state of the avatar. 

Preview the slide, click the back/next button, check that the ClickCounter variable adjusts properly and that the avatar states and the button behaviour match the variable values: 

Photo Selector in action (note the changing variable value)

If all is well, delete the text box with the variable reference. 

Step 10: Photo selector - saving information

Finally, we need to make sure that the course can remember which avatar did the user choose. For this you will need to create a very simple trigger like this: 



In other words, if current avatar's state is 0, the value of AvatarSelected should be set to 0 when the user clicks "Save" button. If avatar's state is 1, the value should be 1, and so forth. Again, numerical state numbers are helpful here. 

Duplicate the trigger and adjust variable values/state names until you've covered all avatar states. 

Congratulations, you've created the most complicate part of this interaction! 

Step 11: Name field

On Slide 2 we will collect user's name to use it throughout the module. First, you will need to create at least the following objects:
  • Question (you should already have the text box with the big orange text)
  • Text Entry field (you can find it in Insert > Controls menu)
  • "Save" button or shape
You can, of course, add more elements. 

Objects on Slide 2

You have probably noticed, that when you create a new Text Entry field, Storyline automatically creates a text variable called TextEntry, as well as the trigger that changes its value based on what the user typed into the text entry box: 


To avoid confusion, you can rename TextEntry variable into something more memorable. In this tutorial I'll assume that you renamed it to Name. 

Technically, once you've done that, there's not a lot left to do on this slide, since the trigger for adjusting the variable has been created automatically and you don't have to do anything else. However, in this example, I wanted to prevent users from not entering anything. With this in mind, I added two triggers to the "Save" button:


This way the user cannot proceed until they have entered at least something into the text entry field. My objective here was to prevent blank values due to attention slips. While the name of the learner is not critical to this module, I didn't want to have any blank values as these would look like errors or strange issues in the e-learning. I didn't worry about gibberish entries (e.g. Ahkjhakshj) as that would be the user's choice. A blank value, however, could be more confusing, as well as not a user's choice. For instance, let's say a user wanted to enter their name, but got distracted. When they came back, they had to hurry up, so they forgot that they didn't enter any name and just clicked "Save". In this situation, having a reminder that the name hasn't been entered may be quite helpful.

Step 12: Department selector

In the real project this interaction is based on, the branching and flow of the slides as well as the type of content presented to the user depended on the nature of their work. Therefore, I needed to gather some information about what my users do. You can use the same idea to display content to users based on their seniority (New Hire vs Veteran employee), position in the department or company (e.g. Junior Associate vs Senior Associate), or location (e.g. Berlin vs Frankfurt; USA vs UK) and so on. 

In this example, I have only three mutually exclusive options available for selection: phone, e-mail, chat. To recreate the same slide, you will need:
  • a question (which you should have)
  • a radio button for each available choice
  • "Save" button or shape
Objects on Slide 3

Once you have created the radio buttons, add them to a Button Set. This way you will need to write less triggers. 

Then create the following True/False variables, all with the default value of "False":
  • Chat
  • Phone
  • Email 
Of course, you can match the names of the variables to the choices you have created.

For every radio button you've created, add two triggers. One of the triggers should adjust the matching variable to the value "True" if the button's state is selected. Second trigger should adjust the variable value to "False" if the button's state is not selected. For example:


Since the radio buttons are in one Button Set, their states will automatically change to normal one another radio button is selected and the variable values will be adjusted without any additional triggers.

Step 13: Prevent user errors

Since navigation and the slides displayed depended on the user's input at this stage, it was crucial for me to ensure that the user does not leave the slide without making a choice. 

To prevent the users from navigating away from this slide, you can add two simple triggers to the "Save" button. One to allow the users to move to next slide if at least one of the radio buttons is selected. The other trigger should show a warning (in this example - a layer with a tooltip message) in case none of the radio buttons is selected: 


Step 14: Badge overview

The final overview slide has very easy triggers. You simply need to adjust the states of the avatar and radio buttons based on the variable values created earlier. You will also need to include a reference to the "Name" variable to display learner's name. To save time, you can copy the avatar with all the states from Slide 1.

Objects on Slide 4

First, create the triggers to adjust avatar state when the timeline starts, based on the value of variable AvatarSelected: 


 Again, easy state names become quite handy in here, as you will need to have a trigger for each avatar state. 
You will notice that sometimes avatars take time to change their state at the slide timeline start and as a result for a second you see the wrong avatar. To work around this issue, I try to add a short (less than a second) "Fade" animation to the avatars, so that the course has a bit more time to change their states.
Finally, you will need to create the triggers to adjust the state of radio buttons to either "Selected" or "Disabled" based on the value of the respective variables. For example:


Respectively, you should create a trigger to adjust the radio button state to "Disabled" if the variable value equals to False. Although you can skip this part, I would recommend disabling the buttons to show the users that no changes are possible on this slide and that they really have to go back to make corrections. 

Congratulations, you've created the badge interaction!

Is there anything missing in this tutorial? Do you have questions? Don't hesitate to let me know in the comments.