Counter: Only counts a button on 1st click??
Oct 17, 2012
By
Eric Matas
There is a good tutorial on making a counter using a variable here: http://community.articulate.com/tutorials/products/building-a-simple-counter.aspx
I need that and a condition: only count the buttons once.
We have 13 items on the main page, and the counter starts at 13 and counts down as a user clicks the items. We only want the countdown to subtract 1 on the first click of each item. Users can re-click items, but the counter should ignore.
Notes:
Each of the 13 items, when clicked, jumps to a new scene.
When users return, the main page is set to Resume saves state.
Any ideas on how to only count a button's first click?
20 Replies
A couple of ideas.
Add a variable for each click. Make it true-false.
Add a trigger to your click that changes the variable to true. Then edit your trigger that increments the counter and moves to the new scene and add a condition. Only increment the counter when your variable = false.
Or have a copy of your item. It shows when the original is clicked and it does not increment the counter. Also, when clicking the original item, add a trigger to hide the item. Make sure these triggers happen BEFORE you move to the new scene.
Would your suggestion work, Gerry, if you used a visited state and set a condition to not adjust the counter variable if state = visited? If he's trying to get a click count of visited pages, that might be a nice aesthetic option if it would work.
Yup--that should also work I would think. Nice thing about Storyline--often many ways to achieve something.
Thanks - I too love the freedom to accomplish things in multiple ways!
I am testing Ashley's condition of "not equal to" visited.
Gerry, if I use the show copy or hide original technique, are you saying that I need those triggers to be "above" the trigger that jumps to another scene?
Yes, when you jump to another slide any remaining triggers for the previous slide do not execute.
So do all you need to do on the first slide with your triggers and then lastly have your trigger that moves to another scene or slide.
With layers, you don't have this restriction since you are still on the "same slide."
Uh-oh, I found trouble!
We changed it up a bit. Or tried to. Instead of the main page button adding to the counter -- that appears on that slide -- we tried to make a button on other slides add to the counter.
The main slide can jump to another scene or just another slide in the same scene, but when users click the "right" button and then return to the main slide, the counter hasn't changed. ??
Is it possible to have a trigger on one slide that updates a variable on another? Please?
variables are not assigned to slides so they can be updated at any time.
Really Gerry's suggesstion of T/F variable is better here. Tracking using a counter is problematic and needs a lot of management
I would add a T/F variable that is changed when the user clicks the return button (if that is a button on your slide or the next button).
and use these as conditions this way you also know which section has been completed.
I would also check the trigger porder because any trigger after the jump to trigger will never fire.
Oh snap! I just screwed up. Phil, you're right about the variables. (Hi Phil!) But I was confused by my trigger options -- I was choosing the wrong button in my condition...because my base layer buttons have similar names.
Everyone be careful when specifying in a condition... "If ___________" to make sure you are not choosing a similarly named button that might be on the base layer! Of course, when you hover on the choices, SL puts a red border around the item to help. I was so excited to try the variables that I created some wacked-out trigger about a button a different layer...oy.
Anyhow, thanks for the help. Now we choose whatever button seems "right" to count the module as "viewed" and we trigger a variable adjustment based on the click, but with the condition that the button's state is not equal to "visited." So far so good...
Is there anyway to have the counter increase when the object is selected, and decrease when the object is deselected? I know that this is just basically a click that is changing the state of the object (to selected and normal), so not sure if this is possible.
I'm using a pick many quiz question.
Thanks!
Hi Shelley,
I'm trying to do exactly the same thing. It's been a while, but did you manage to solve the issue?
At this point, I have a 'selected' state for each of my pick many items. I've tried using a customized state for each item with a conditional trigger and a subtract 1 variable trigger together, but that didn't work. Just learning how to use conditions and variables.
Let me know if you figured it out.
Thanks,
Hugh
Hi Hugh,
I quickly created a Pick Many quiz and I think I've achieved what you're after. I've attached it here.
I quickly skimmed this thread and saw that in the suggestions to Eric's question, Phil had recommended using T/F for tracking counters. So please note that I did NOT do that here. I simply went with your request which you said is like the one Shelley made to increase the counter for selected and decrease it for deselected items. Hopefully, Phil will weigh in if it's still best to add a T/F variable here.
If you have any questions about what I did, please shout out and I'll add instructions here.
Hi Rebecca,
That works great and is so simple. I knew it was right under my nose.
Thanks,
Hugh
That sort of works but if I press 232222 then it would mark as correct which is actually wrong you need to capture if a wrong key is pressed not if 4 2s are pressed.
Hence the T/F to catch this and ensure 4 2s are pressed as well
Hi Phil,
Can you please explain what you mean by the 232222? I want to understand if we need a T/F variable here, but I don't have and 2's and 3's in the slide? I just quickly threw tog. a "scenario" (and I use the term loosely) where Learners were asked to select items. If they selected, the count would go up; if they deselected, the count would go down. Looks like this:
Only marks as correct if they choose the objects with red, which is how the "pick many" is set up. And it seems to be adding or subtracting correctly no matter which way I do it?
Sorry Rebecca wrong post in the wrong place
No worries - but, since you're here would a situation like this need the additional T/F variable?
Not sure, if it works then the answer is no.
I wouldn't have thought that would work, but it appears it is
OK. Thanks! Didn't want to steer Hugh in the wrong direction!
Thanks Rebecca, this was exactly what I was looking for. I never got that working as I didn't enter a condition for it. Seems a bit of a roundabout way of doing it, but that might be the only way I guess. Worked like a charm though!
Adrian, tx for posting. I'd forgotten all about this one! Good to know it "still works."
This discussion is closed. You can start a new discussion or contact Articulate Support.