Add Variable Count One Time Only
Apr 13, 2017
By
Tim Ballew
I am adding a variable count for slide layers where the variable is incremented by 1 at the start of the timeline. Is it possible to only have the variable count increment if this is the users first time viewing the given layer?
Action = Adjust Variable
Variable name is Score
Operator = + Add
Value = Value 1
When = Timeline starts
Object = Layer
The goal is to award points for visiting each layer, but I don't want to add points for simply revisiting the same layers.
25 Replies
Have a look at the attached and see if this setup would work for your project. I use a button's Visited state to determine if a variable should be increased.
Thanks Michael! Great idea, I think that should do the trick.
I tried this using one of the content library templates and it works for the first 3 layers, but not the 4th. The triggers are all setup identically, not sure what I am missing here.
Hello Tim,
Thanks for sharing your file so that we could understand what you were describing. I was able to see the same behavior you were reporting, but inconsistently as it did work for me at times.
That being said, grouped items can do that at times. I like to use variables on the layers when the layers are dependent on being viewed.
Check out my solution attached and see if that assists you.
Thanks Leslie, that did the trick!
However I'm a little confused on what you did. You had the default value for each Step as False, but why did it not continue to increment if you clicked the step multiple times?
I had to add an additional trigger to change the step from False to True after the first click. Then it wouldn't continue to increment, but yours worked without the additional trigger. So I feel like I am missing something or at the very least wasn't as efficient as I could have been.
Thanks Again!
Hi Tim - I used different variables.
So, each step started as false, right?
I'm adding to the score as long as the step is still false, meaning not visited. Notice that trigger order is important here - adjusting the score prior to the layer opening...
Because, the step changes to true (visited) once that timeline starts:
Does that help?
Ahh I missed the trigger on the layer.
I basically did the same thing, I just set the step = True on the base layer between the add score and show layer triggers.
Thanks, that was very helpful!
Awesome - glad to be able to assist Tim :)
Oh, another tip Tim -
If you're ever looking at a file and trying to track variables (like we just did here), you can click on the number in the variables panel to see where it is being used.
I know that saves me when trying to dive in and understand user files :)
Thanks Michael Hinze for uploading your storyline file. It was useful for my project. I was struggling to create a situation where users were required to hover over info buttons prior to proceeding in the training.
The condition placed on the shape to add1 only if the shape wasn't in a state of visited did the trick to prevent repeated var increases for hovering over the same button.
Thanks!!
Good to hear the "old stuff" is still useful :-)
I was struggling to create a situation where users were required to hover over info buttons prior to proceeding in the training.
In this case, you could also base a trigger event on the state of ALL your info buttons having a state of VISITED. Make NEXT button visible when state of all INFO buttons is VISITED.
Maybe?
Hey guys, I'm looking at this now and it looks like the interface has changed. There is no longer an 'operator' field in the trigger wizard. Instead of being able to increment with the adjust value trigger, now what you have to do is set it to 'Add' instead of 'Adjust value' Please update, I stumbled on this new feature by accident!
Hello Lindsay!
We've added a new Trigger Panel in the most recent update! It's an incredible addition intended for quickening your workflow. The triggers and variables are still the same, so no need to worry about learning the Trigger Panel all over again!
Good news, you can always switch back to the old Trigger Panel without losing any of your work!
Call me slow but I can't seem to make my slides do something similar. I want the score to add +1 only when the correct choice is clicked once. Not when clicking on it again or when revisiting the slide.
I have triggers that say: change the state of the object to visited when clicked.
Also included: add +1 only when object state is normal (default state).
See attached storyline file. What am I doing wrong? Thanks for any assistance!
Based on your description, my sugegstion would be an additional True/False trigger to limit how many time the +1 trigger can work.
That should keep the +1 from working more than once.
What Jerry says will work. Something else you should know is that you shouldn't create triggers to set state to "Visited", of "Selected", or any other state that is built-in. You can recognize built-in states. When you create a new state, there is a drop down menu in the popup that asks for its name. All the states already on the list are built in. That means they come with their own triggers to make them function. If you write another trigger, it will most likely conflict with the native trigger, and usually causes really strange results.
thanks to you both Walt and Jerry -- it works! Why I wanted to make it more difficult, I can't tell you. ;-)
Appreciate the additional information about when to use a new state vs. built-in. This is a great community!
Sorry to come back for assistance once again -- I made the changes to the triggers, but now my points will not accrue in value. This file is only one of several scenes I have, all with the same triggers - click the right option once and get a point added to your score. Click the right answer again, no point is added. But the total points should accure in the feedback layer's upper right corner.
Any thoughts on what I am programming incorrectly?
Thanks in advance!
The order of triggers is CRITICAL when you put several events to occur on a single click.
Move the "Set Q1Done = True" to the bottom of the group so it's the last thing that happens.
Also, the Q1Done variable is only for the first slide. On the second slide you would use a new Q2Done variable.
Be sure to set the Q1Done = true when they click on ANY of the answers, right or wrong, else they can just change their answer, unless that's what you want them to do.
I so appreciate your help. Now, sorry to say, the first point scored does not appear.
On slides 2-9 the scoring is correct. But for the first slide, if the point is correct, nothing appears in the upper right of the feedback screen. Any thoughts? I forgot to ask, for each scene that follows, must I use Q9Done, Q10Done, and so on? Or can I reuse Q1Done, etc. for each scene?
You have the variable misspelled on the first Feedback layer. ;)
DOH! Good eyes Jerry. Thanks again.
Laura Bunte - Instructional Design Consultant
lbunte@batteriesplus.com | 224-795-3245
That is fabulous and solved a problem I've had for a long time!