Input formula

Jun 05, 2018

Hi,

i have a list of items:

- number of tires of truck - 6

- cost of each tire - 350,00

- lifetime tires - 65.000 km

- km of truck/year - 75.000 km

i need calcute the cost of tires by year with conditions above, and the learn must click on this items and present a formula to calculate the value like this:

number of tires of truck x cost of each tire x (km of truck/year / lifetime tires) =

and in the result appears in the box result = RESULT = 2.423,08

how can i make this, any help

sorry my english

11 Replies
Joanne Chen

Hi Mirko, 

What are the variables in the formula? Are these listed terms all constant or just a number example? If all the listed terms are variables, you can add numeric entey for each one and a number variable for the result. You will then have five variables: 

NumericEntey - number of tires of truck

NumericEntey1  - cost of each tire

NumericEntey2 - lifetime tires

NumericEntey3 - km of truck/year

Variable Result

 

Set the triggers in sequences to get the result 

  1. Set variable Result equal to the value of NumericEntey when user clicks submit BTN
  2. Multiply variable Result by NumericEntey1 when user clicks submit BTN
  3. Multiply variable Result by NumericEntey2 when user clicks submit BTN
  4. Divide variable Result by NumericEntey3 when user clicks submit BTN
Mirko Petra

Hi Joanne,

Yes, i get the result with the triggers that you show.

My problem is:

The learner have the constants above and the learner must click in the constant and he make the formula, and when he click on the signal = the result appear.

I want that the learner, show me the formula and he must choose the constants, but when he choose by click the constants of formula appears.

I hope you understand, sorry my english

Thanks 

Joanne Chen

Hi Mirko,

It sounds like you can use drag and drop for your fomula, if I undertstand correctly. We can see the fomula as A*B*(C/D)=Result. A, B, C, D are drop targets.

Set each variable (A-D) equal to the number of the drag object. For example, set variable A equal to 6 when object 'number of tires of truck' dropped on target A.

Set the triggers in sequences to get the result 

  1. Set variable Result equal to the value of variable A when user clicks signal BTN
  2. Multiply variable Result by variable B when user clicks signal BTN
  3. Multiply variable Result by variable C when user clicks signal BTN
  4. Divide variable Result by variable D when user clicks signal BTN

If this is not what you expected, you may need to explain more about what choices do you like users to make. For example do you want users to choose what mathematical symbol to use between constants in the fomular?

Mirko Petra

I Joanne, thanks for your time.

Its sounds like drag and drop, but you must click in the item and the item must appear in the box.

I send a image that what i need.

I need that the learns know how make the formula e have the correct result. If the result of formula or the formual is not correct, in submit final is verified.

THANKS

 

Joanne Chen

Hi Mirko, 

What you need looks very complex if you do it in Storyline variables and triggers. However, I made a sample demo by your file. You can try yourself clicking on the red one (two text, two symbol) and see how it works in the uploaded file below. As you may aware, it will be a huge and complicated work if you want to include all the listed variables and symbol functions. 

Therefore, perhaps you should look for JS code and see if it can be done that way. (I am not a JS expert)

This discussion is closed. You can start a new discussion or contact Articulate Support.