Hello, I am new to Storyline. I have a self-graded assessment for a slide I am creating. What percentage do you manager, and what percentage do you sell real estate? I do not want the user to advance to the next slide until they put amounts in both boxes that total 100%. I would also like to show a pop-up box to inform them of the requirement if they try to add any numbers to the two choices that do not add up to 100%. Thanks in advance for your help.
I've attached a story that I believe achieves what you want. Learners must either click outside the numeric entry boxes after typing in the numbers or press the TAB key to move "off" these boxes.
There are 3 number variables: managing, selling, and total. The two slide triggers that I created, in this order, top to bottom:
Set Total equal to numericentrymanaging when numericentrymanaging changes
Add numericentryselling to Total when numericentryselling changes
The two object triggers are inserted automatically when the numeric entry boxes are inserted from Insert >Data Entry :Numeric entry
Finally, I modified the trigger on the next button to jump to the next slide when Total is equal to 100.
I think that does it. Question/comments, give a holler.
Here's an updated version of the file, per our discussion. I've added a Try again Layer, which is triggered from the base layer if the Total doesn't equal 100.
The try again layer has an OK button.
This button has 3 triggers:
Set the "managing" variable to 0 when the Learner clicks
Set the "selling" variable to 0 when the Learner clicks
Close the Try Again layer when the Learner clicks.
This way if the Learner enters an incorrect amount, they can click OK from the Try Again layer and, umm... Try Again!
The only catch to your trigger structure is that if you input the number on the right first, the total value won't update. This can be fixed by switching the 1st trigger to match the second.
Shoot! Bad me for not trying it backwards, forwards, and upside down. I know better than that. And good you for catching it. Thanks so much. From me and John!
I don't think that solution quite works, though. Consider this use-case:
I put 50 in the first box
When I get to the second box I reconsider my answer and put in 60
I go back to the first box and put in 40
The end result is that the two boxes add up to 100, but the total stored in the variable is at 150.
I can think of two possible ways to address that:
Wait until the user clicks the next button to sum up the two fields (probably the more elegant way)
Reset the total to zero each time the user leaves a field, something like this:
Set the total to zero
Add the value from the left to the total
Add the value from the right to the total
The first option seems like it'd be easier to implement, although the second has the advantage of showing the current total (handy for people who aren't as strong in math, or if you need to apply this logic when there are many fields to sum up).
13 Replies
Hi John,
Can you upload that slide so we can see how you've set it up?
Here is a rough draft of what I am hoping to achieve. Thanks!
Hi John,
I've attached a story that I believe achieves what you want. Learners must either click outside the numeric entry boxes after typing in the numbers or press the TAB key to move "off" these boxes.
There are 3 number variables: managing, selling, and total. The two slide triggers that I created, in this order, top to bottom:
Set Total equal to numericentrymanaging when numericentrymanaging changes
Add numericentryselling to Total when numericentryselling changes
The two object triggers are inserted automatically when the numeric entry boxes are inserted from Insert >Data Entry :Numeric entry
Finally, I modified the trigger on the next button to jump to the next slide when Total is equal to 100.
I think that does it. Question/comments, give a holler.
Bless you Rebecca!
Glad it does what you need. And welcome to the community.
Hi John,
Here's an updated version of the file, per our discussion. I've added a Try again Layer, which is triggered from the base layer if the Total doesn't equal 100.
The try again layer has an OK button.
This button has 3 triggers:
This way if the Learner enters an incorrect amount, they can click OK from the Try Again layer and, umm... Try Again!
Becky,
Great work tackling this one!
The only catch to your trigger structure is that if you input the number on the right first, the total value won't update. This can be fixed by switching the 1st trigger to match the second.
I've attached.
Hi Mike,
Shoot! Bad me for not trying it backwards, forwards, and upside down. I know better than that. And good you for catching it. Thanks so much. From me and John!
Thank you to both Mike and Rebecca. I'm having a lot of fun with Storyline! I appreciate your help.
The end result is that the two boxes add up to 100, but the total stored in the variable is at 150.
I can think of two possible ways to address that:
The first option seems like it'd be easier to implement, although the second has the advantage of showing the current total (handy for people who aren't as strong in math, or if you need to apply this logic when there are many fields to sum up).
Hi Simon and welcome to Heroes!
This thread is a bit older, but you've definitely hit upon something with this .story file. Thanks for sharing your two solutions here!
this was helpful...
Glad that this older thread helped you out Mopah and feel free to let us know if you need anything else.
This discussion is closed. You can start a new discussion or contact Articulate Support.