Hi Howie, if you want more inspiration, check out eLearning Challenge #162. My entry had users enter their own variable numbers, then adds the value of those together. As Walt said, you could have anything cause the variables to be added. You just want to make sure there's a way to reset the total number variable should the user go back in the course, so you don't end up adding the numbers over again.
You would need triggers to change the variable values on that screen, you could do it when variable changes but could get into a real mess. If however you add a trigger to run the calculation the first variable changes and ensure the first trigger resets the calculated vale to 0 before you run the calculation there should not be a problem,.
Although looking at your design i would try and do it over three pages in stead, two pages where they complete the assessment and another with the results, it does look odd entering the page seeing the results but still needing to complete them.
The addition of 14 - 21 is all done when the timeline starts, and the values are still 0. Your problem is to find something to trigger the calculations, and the bigger problem is is has to start only after all the selections are made. That makes it tough, because people may miss one, or change their mind.
I think the fastest way is to put the results and the triggers to add 14 - 21 on a layer. Put a button on the page that says I'm done, show me the results, or some such. Have it show the layer which can do the calculations when its timeline starts.
SL's built-in triggers allow you to increment a variable by one other variable, so you need at least six triggers (maybe more, if you want to clear the total before you start adding).
The other option is to write a javascript to add them, whichever you think is easier.
14 Replies
At the point where you want the addition to be done, for example, the user clicks the Calculate button, use these triggers:
Adjust variable TotalSum assign value 0 when user clicks Calculate
Adjust variable TotalSum add variable PartOne when user clicks ...
Adjust variable TotalSum add variable PartTwo when user ...
Adjust variable TotalSum add variable PartThree when user ...
Thanks for this Walt. A couple of questions.
Ideally i don't want a calculate button. Is it possible to do this by using Timeline starts for example?
Also...
When I add the 2nd variable listed above, i do not get the +add option in the Operator dropdown, only =Assignment?
Make sure the variable is a number type instead of a text type.
Yes, I usually do them when the timeline starts, but anything that initiates an action will do it.
That worked! Thanks for all your help guys. I've been working on this slide for most of the day and your help as been invaluable. Thanks again.
Hi Howie, if you want more inspiration, check out eLearning Challenge #162. My entry had users enter their own variable numbers, then adds the value of those together. As Walt said, you could have anything cause the variables to be added. You just want to make sure there's a way to reset the total number variable should the user go back in the course, so you don't end up adding the numbers over again.
The variables work great except some of the ones they are adding are over 2 pages.
Those ones do not work. I've created a 60 second screen cast to demo. Any help would be greatly appreciated
You would need triggers to change the variable values on that screen, you could do it when variable changes but could get into a real mess. If however you add a trigger to run the calculation the first variable changes and ensure the first trigger resets the calculated vale to 0 before you run the calculation there should not be a problem,.
Although looking at your design i would try and do it over three pages in stead, two pages where they complete the assessment and another with the results, it does look odd entering the page seeing the results but still needing to complete them.
I agree it looks odd. I'm on a deadline and trying to fix someone's work so i'm trying to avoid rebuilding it.
This is the trigger panel, Is it because variable 14 to 21 are set to 0 on this page?
The addition of 14 - 21 is all done when the timeline starts, and the values are still 0. Your problem is to find something to trigger the calculations, and the bigger problem is is has to start only after all the selections are made. That makes it tough, because people may miss one, or change their mind.
I think the fastest way is to put the results and the triggers to add 14 - 21 on a layer. Put a button on the page that says I'm done, show me the results, or some such. Have it show the layer which can do the calculations when its timeline starts.
If I have six different number variables I want to sum would I need to create 6 triggers or is there a better way?
I have six scenes which all have separate scores/variables but I want to add them together for a final scene that also has a variable.
SL's built-in triggers allow you to increment a variable by one other variable, so you need at least six triggers (maybe more, if you want to clear the total before you start adding).
The other option is to write a javascript to add them, whichever you think is easier.
Is it possible to add the sum of the variables as seen below?
It will take a few triggers, but it can easily be done. For example, to calculate the addl column:
1. Create a trigger that assigns Physical3inv to Inv_Phys_Sum_addl
2. Create a trigger that adds Physical4inv to Inv_Phys_Sum_addl
This discussion is closed. You can start a new discussion or contact Articulate Support.