Trouble with variables
Jan 06, 2013
Hi Folks,
I'm trying out variables for the first time and am having some trouble. The basic idea is that I want my learner to take this one page survey to determine whether or not they are a content contributor. I thought it would be easier to explain the problem rather than write it. I recorded a screenr (under 2 min) that describes what I've done so far and where I'm stuck: https://player.vimeo.com/video/204929745
The project file is attached
Thanks!
Ethan
15 Replies
Hi Ethan-
Thanks for posting the Screenr - it really helped me understand what you were going for.
I reworked your file using a true/false variable. Your initial approach to add a number value to the checkbox worked correctly for me when I clicked the first choice... but it didn't account for a user deselecting the box and making another choice. That could be where you were running into issues.
Check out the attached file to see if it works for you. Using a true/false, I toggled the value based on whether the first button's state was equal or not equal to selected.
I see. That's strange that the interaction worked for you- The version I made still will only show the 'no' layer even with button one checked.
The reason that I went with a numbered variable instead of true/false because if they check any of those boxes, then they would be considered a content contributor. Is this possible with true/false or was my hunch to use the numbered variable correct?
Thanks again!
Ethan
If you want to use a number variable, it often helps to assign a value instead of adding a value, selecting and deselecting is a common issue. I normally assign the triggers on the Next or submit buttons to get round this
Ethan - in that case, you could simply use states to evaluate whether all the items are not selected or if one or more is selected?
Here's an example using only triggers and states and no variables.
@Phil - great point re: assigning a number value vs. adding a number value.
Phil/Davide,
Could one of you please supply an explanation/example of what you mean by that?
Thanks
Bruce
@David- Thanks, that totally makes sense now!
@Phil- +1 to Bruce's request for an example of what you mean!
Thanks as always,
E
The assignment operator is simply an equals sign where whatever's on the right side of the variable's assignment is the value of the variable.
Apple=1
The add (+) will continue adding a value to the variable each time the button's clicked.
Apple+1
Demo
Source
OK slightly different take on this. How could we display a different set of feedback on a results slide based on what answers were selected?
For example,
Question Slide: "Which of the following are fruits? (Select all the apply)"
A. Apple
B. Banana
C. Potato
D. Cheeseburger
If the user selects B and D the feedback would be something like
A. Apple - An apple is a fruit that you didn't select
B. Banana - Yes this is a fruit
D. Cheeseburger - Sorry a cheeseburger is not a fruit
Hi Mike,
If you create a trigger which simply says "If Choice A is selected (when submit button is clicked), then show Layer (Apple Is a Fruit... )
And create triggers for each of your options that you would want different layers to show. There are ways to combine triggers and streamline it, but this will work just fine.
It's all about what choice (button) is selected when the user clicks the Submit button.
Does this make sense?
Hi Mike,
Ben is correct. Thought I'd throw a demo story together. I didn't do all permutations, but enough for demo purposes. Coupla' things I did:
Show layer "Incorrect Apple_Potato" when the user clicks the submit button
On Condition
Button 1 apple equals selected AND Button 3 potato equals selected
So, it's really basic, but it does give the Learner specific feedback depending on the choices they made. Thanks for the idea!
I have a similar question.
I have a list of 12 items with check boxes next to each.
I need to show one of three possible outcomes:
Outcome 1:If user selects all of Options 1, 2, 3, 4, 5,7,12 - The "Correct" layer is shown
Outcome 2: If user selects any of Options 6,8, 9, 10, 11 - The "Incorrect" Layer is shown.
Outcome 3: If user selects some of the Options 1, 2, 3, 4, 5, 7, 12 - An "Incomplete" Layer is shown.
I have been trying to figure this out but am stumped.
Any help would be wicked awesome!
Kurt
Hi Kurt,
This is a bit of an older thread, so I'm not sure if they're still subscribed. If you're able to post your .story file here we can take a look at how you've got this set up and offer advice from there. From just the description you've provided it sounds like you'll need to set the trigger to Show layer (pick the layer) when the user clicks on - and then add the conditions for all, any of, etc. the different options based on the layer you're triggering.
Hi Kurt,
I see that you got some help from Dipti and James over here. Nice!
This discussion is closed. You can start a new discussion or contact Articulate Support.