Check slide 1 in the attached sample. You can do all the math in SL, except for rounding, and that has to be done in javascript. If you are going to repeat the action on the second slide, you need to use new variables, or reset the variables when the slide timeline starts.
You can do all the math in javascript, but I did it in SL, because it may be more obvious what is happening.
The box with the random number is a text box. Any text that starts with and ends with % and contains the name of a Variable between them is a variable reference. When the project is run, the value of the variable will show in its place. The textbox has a trigger that sets the variable to a random number when it is clicked.
The box for the learner input is a numeric input box. They are designed to store the input value into a variable when they lose focus ( press return, click elsewhere on the slide, hit tab).
The Submit button has triggers that add the two number variables together, multiply them by 2.3, and execute the javascript, which you can read if you edit the trigger.
The javascript (which runs only in the published version), does the rounding.
Studying the triggers and understanding what they do, and when is the best way to understand the process, which will help you be able to replicate it.
If you have questions, I will be glad to answer them.
3 Replies
Check slide 1 in the attached sample. You can do all the math in SL, except for rounding, and that has to be done in javascript. If you are going to repeat the action on the second slide, you need to use new variables, or reset the variables when the slide timeline starts.
You can do all the math in javascript, but I did it in SL, because it may be more obvious what is happening.
Hi Walt,
Thank you so much. Could you break down how this was done? I'm very interested in learning the process. Thanks again.
The box with the random number is a text box. Any text that starts with and ends with % and contains the name of a Variable between them is a variable reference. When the project is run, the value of the variable will show in its place. The textbox has a trigger that sets the variable to a random number when it is clicked.
The box for the learner input is a numeric input box. They are designed to store the input value into a variable when they lose focus ( press return, click elsewhere on the slide, hit tab).
The Submit button has triggers that add the two number variables together, multiply them by 2.3, and execute the javascript, which you can read if you edit the trigger.
The javascript (which runs only in the published version), does the rounding.
Studying the triggers and understanding what they do, and when is the best way to understand the process, which will help you be able to replicate it.
If you have questions, I will be glad to answer them.