Copy link to clipboard
Copied
In captivate 7, I'd like to create an interaction where learners enter their salry into a field and it calculates a sum. Then, another field where they enter that sum and a percentage based on the scenario question and they get the final sum. For example:
Step 1: please enter your salary here: ____
The number entered is multiplied behind the scenes by 1.2 and lands in a place on the slide.
Step 2: please take the sum above and enter here:_____
Please take the correct percentage from scenario question and enter here:____
Then a final number would multiply the two entries in step 2.
Any help provided will be greatly appreciated!
Melissa
Copy link to clipboard
Copied
Yes, with advanced or shared actions and variables, as long as you can do the maths with the 4 basic operators: + - * /
Use a Text Entry Box to enter the salary, it will be stored in the associated variable. You can trigger an advanced/shared action as Success action (since you will not validate the TEB) that calculates the values you want and store them in other user variables. If those user variables are inserted in a text container (shape or caption) the result will show up after executing the action.
I have not directly such an example, but look at the use of the Expression statement in this old blog post where I calculate time:
Copy link to clipboard
Copied
Lilybiri - thank you for the quick reply - I'll check out the blog post for sure
Copy link to clipboard
Copied
The problem will likely be that you won't like the format of the results. Captivate's Advanced Actions don't currently have any facility for rounding up or down to allow you to choose how many decimal places are in the final result.
Copy link to clipboard
Copied
Adding a short JS can solve that...right?