Changing States based on Variables
Dec 05, 2012
Hello everyone
I am new to Storyline and am a little stuck! I have created a course with several scenes, the first one contains a contents slide with buttons. I am trying to get the states on those buttons to change based on whether the learner has successfully completed the quiz on each scene/section:
I have added triggers to the contents page to change the state of say Button 1 if Results = pass but I can't get it to work and wonder if it is possible to get those states to change in this way. Basically I only want the learner to be able to proceed to scene 2 if they have successfully completed scene 1, so I only want those buttons to become active if this is the case.
Can anyone give me ideas on what I am doing wrong?
Thanks in advance!
28 Replies
Hi, Jo!
What does your trigger look like? The one that changes the state indicated above. More specifically, what event are you using (When the user clicks, when the timeline starts, etc..)
Whenever I see something like this not working, it usually ends up being the event. If it's set to "When the user clicks" the slide is waiting for that condition and most of the time, it never happens When the timeline starts isn't dependent on user action:)
Thanks for your reply Steve!
Here is what I have currently:
So my Button is called URLs. I've tried different arrangement with the Event but still no joy. When I preview and run through Scene 1 and pass the quiz the URL button is still inactive?
Looks like it's looking for the trigger to be *exactly* 80.00. You might change it to equal to or greater than to see if it makes a difference. Exactly 80% might not be attainable depending on how your score weights are setup and the total number of questions.
Thanks Steve, I have tried that but it is not behaving. I think I must have something else in there somewhere that is conflicting. I will take another look through it to see if I can figure it out.
Well, this is weird. I used the Results.ScorePercent variable and it wasn't working for me either, i.e., changing a predesiigned SL button to normal (initially set to disabled) and I tried a couple variations to see if it was something specific.
First, I added a text box with a reference to the Results.ScorePercent to see if it IS actually recording properly when the Menu slide is revisited.
Check
What if the button is initially set to hidden.
Nope
What if a try a different object
So, I inserted an illustrated character with a confused expression and set her state to change to happy when the timeline starts if the Results.ScorePercent is equal to or greater than 80. And guess what, that works. But the SL button remains hidden, even though it has the SAME trigger and condition set.
Going back to create my "own" button from a shape and test it out. Back in a few
Well, yes, it does work BUT I also discovered (she says sheepishly) that I did confuse SL a bit and now they're both working.
It seems that on the Trigger for the SL button I'd incorrectly identified the Object drop-down in the Trigger Wizard and had it set to the BUTTON instead of to the slide.
So, my slide's name is 1.1.1.1puzzled and my Button's name is Button 1 to Scene 2.
When the trigger wizard looked like this
Action Change state of
On Object: Button 1 To scene 2
To state: Normal
When: Timeline starts
On Object: Button 1 to Scene 1
NADA
But when I set the trigger wizard (ahem) correctly to this
Action Change state of
On Object: Button 1 To scene 2
To state: Normal
When: Timeline starts
On Object: 1.1.1.1 puzzled
Working as designed!
That last object drop-down has tripped me up before. Maybe I'll look there first after embarrassing myself!
Could that be what you did, Jo?
Thanks Rebecca, I have given that a go but still no joy - I have no idea what I am doing wrong!
When I complete the first scene and quiz then revisit the Menu slide the next button (URLs) is still inactive. I have that button's default state as 'disabled' and have the trigger set like this currently:
pooh! any chance you could upload it here? it sometimes hits community members smack in the eye, esp. the SuperHeroes. and now you've got my curiosity peaked.
Hi Jo,
For testing things like this, stick a couple of text fields on screen to track the vars and see if you're getting data like you want.
Simply add the text field and put %TheVarName% in the field and it'll display the data.
Another question, is what is the state of the buttons when the timeline starts?
Looks like the event is assigned to the timeline start of the slide. You might try making it trigger on the timeline start of the object itself. Based on the load order of objects and triggers, it could be that the object isn't visible yet and isn't there to hear the command.
Funny, Steve. For me, as I noted above, when I made it the start of the timeline of the object itself, it didn't work. But when I made it the start of the timeline for the slide, it did.
Thanks guys! Still not working though ;-(
Steve, I did what you suggested and no good I'm afraid. Rebecca, I'd love to upload it but its a huge course as it's mainly video scenes. Bill, thanks but I'm not sure where or how to apply your suggestion! I'm probably doing something daft and missing something obvious. This is what I currently have on my Menu page Triggers:
I'm scoring 100% on the Main (1st) scene so the URLs button state should switch to Normal (the initial state for URLs is disabled). I think perhaps I was trying to be too clever with my pilot course! Perhaps I should have kept it simple and just put the quizzing at the end of the entire course, rather than at the end of each scene. I guess I could try that to strip it down, then perhaps I can get the states to work just based on the scenes being visited without the complication of the results slide variables...
Hi, Jo -
Not sure if this could cause your problem but the total number of points in your quiz... if it doesn't total more than 80 points, that condition will never be met. Did you mean to check that score against results.scorePercent?
Hi Steve, Thanks - I just tried setting the Condition to 'results.scorePercent' but still no good.
Have you tried adding a reference to check what the value of results.scorePercent and result.scorePoints is. This is what Bill suggested
Have you assigned the questions to the results slide?
I also think this needs to be the timeline of the slide and not the object.
Can you post just that slide?
Hi Jo,
This may not be the problem but I have run into difficulties like this before and the solution has ended up being the "When Revisiting" option that you can see from "Story View" in the lower right corner. I think you'll need to make sure that the "When Revisiting" option is set to "Automatically Decide" to achieve what you are going for. Variables and triggers can get complicated so hopefully this at least helps you narrow things down.
Interesting, I wonder if this is a bug between vars and scenes??
I've tried to reproduce it and the var changes, but the state won't. I've even tried tweaking the home timeline saved state and and various trigger settings, and still no luck.
Maybe someone else can get it working?
Hi Jo,
Here's something I"d thrown tog. yesterday - just threw out some other garbage I'd had in it now. It's only a few slides, 2 scenes, and 1 quiz question, so WAY simplified, but I wondered if looking at anything in it might help.
Here's a multi-section example that uses the variable to change states. Maybe this'll help you sort through it.
Hi Jo,
To check the value of your variable as Bill and Phil suggest, just add a text box to your slides and insert the name of the variable surrounded by % like this - %results.scorePercent% - if the value of your variable changes, you will see it immediately. You can copy/paste this text box on all of your questions slides and to the results slide also.
Hope it helps and have a nice day!
Annie
Hey, Bill -
In your example, Q1Results never *changes* while on that slide. It changes on another one. If you changed the trigger to "when the timeline starts IF Q1Results is == true" it'd work.
Hey Steve,
Yup, that got it. I WHEN'd when I should have IF'd.. LOL
Jo, this should help you get it working. You'll need to add the triggers for the other quizzes.
Thank you all so much for your assistance and support so far. I'm afraid I'm a little slow as I'm so new to this, but I have just done the variable test and the result was 0 - so now I'm even more confused! That would explain why the state is not budging though hey! I'm confused because the first scene's results slide is referenced as '5.28 results slide' and when doing the quiz it states I pass with 100%, but the test shows zero.
I will work through all your suggestions and see how I get on, but what I have noticed is that when I moved scenes around and re-ordered them they didn't automatically renumber if you see what I mean and I found that a bit tricky as they then appear to not be in a logical order. I'm wondered that even though I'm picking results slide 5 it may actually be a different slide, if that make sense...
Thanks again for your samples, they are really helpful and I'm quite overwhelmed with the help you've offered and time you've given me so far.
I will try to upload a reduced version of my course too for those of you who would like to see for yourselves what a mess I've got myself into!!
That almost sounds like you might be referencing the wrong variable.
This discussion is closed. You can start a new discussion or contact Articulate Support.