Using a survey to set a variable value

Nov 19, 2012

Hello All,

I want to have a user set a variable value by selecting from a list.  I am thinking that I could set up a survey question with each of the possible choices then tell storyline to set the variable value equal to the choice they selected with the radio button.

this is how it would look

the user would select their department, then going forward only certain slides would be open for them to see.  Basically I'm customizing content based on their need.

any suggestions?

8 Replies
Ari Avivi

Okay so I think I've solved that problem by setting a button to change the value of a variable then putting a trigger on the slide that says at the start of a timeline if the variable does not equal to the specific department jump to the next silde.

The only issue is there is a flash of the slide I am skipping.  kind of inelelgant.  Any suggestions here?

Jeanette Brooks

Hi Ari, not sure what kind of content you have on the slides that are being skipped, but one thing you might try is to select the objects that appear at the beginning of the timeline, and apply a fade in animation, medium speed. That might provide just enough of a "cushion" in the timeline that the objects don't actually appear at all when your conditional trigger causes learners to skip past the slide. 

George Walz

Here's a question for you; I have a menu screen that provides the learner options to explore.  I have assigned a variable to each path with a default of 0. When they click on the path, it takes them to that slide section and the variable is adjusted by 1. When completed, they return to the menu screen.  I have a trigger that changes the state of the menu obect to visited if the variable is greater than or equal to 1.  However, it does not change the state... although the variable has been adjusted, the state of the object remains normal... what am I misssing. How do I change the state of the menu object to visited when they return to that screen from elsewhere in the course?

Luke Stollings

I'm having a problem with a survey.  Other Question types/Survey types seem to automatically create a variable, such as TextEntry, when a question slide is created, and I can do whatever I want with the variable later.  But this doesn't happen with a Pick One survey slide (no variable is created as far as I can tell), so I can't extract the answer choice to use in the way described in this thread.  Has something changed in the way surveys work?

Maria Costa-Stienstra

Hi, Luke, and welcome to E-Learning Heroes! ✨

You are correct that the Pick one survey type does not automatically create a variable. However, you can use the state of the button to assign value to a variable you create.

I'm attaching a sample .story file, but here's a recap:

  • Create a number variable (we'll call it Choice).
  • Add triggers assigning value to the variable depending on the button selected:

Windows 10 (1) 2021-05-21 at 12.05.48 PM

  • It's important to make sure you're not shuffling your choices.

Windows 10 (1) 2021-05-21 at 12.07.11 PM

Here's an example of what it will look like:

Screen Recording 2021-05-21 at 12.08.46 PM

You can also use the value of that variable as a condition (if you want to branch scenarios, for example).

Let me know if this works!