Problem dividing a number in a placeholder

Sep 26, 2013

Hope someone can help. I have put together a number of slides to work out course costs based on a number of variables such as where the client is located, number of people to be trained etc.

So far so good and I can now provide an accurate cost per course figure using a variable i have rather originally titled TrainingCost.

But then i had the bright idea of including the price per person (ppp) based on either 12 students or 24 students. I thought it would be relatively simpe!

so I created 2 x variables (PPP12 and PPP24)

and created 2 triggers for each variable:

Add TrainingCost to PPP12 when the timeline starts

Divide PPP12 by 12 when the timeline starts

Add TrainingCost to PPP24 when the timeline starts

Divide PPP24 by 24 when the timeline starts

Here's the thing when I do it the first time around it works perfectly. However when I press a button 'recalculate' which takes you back to the start, each time i go through the calculation it adds a small amount onto the ppp (but not the TrainingCost) each time I go through it again for no logical reason. All the slides are set to 'reset to initial state'

Can anyone shed any light on why this may be happening or alternatively suggest a different way of dividing the Training Cost variable?

Any help would be much appreciated

Paul

5 Replies
Antony Snow

Hi Paul,

Without seeing the slide in question, its hard to say why the calculation is adding a small, un-related amount to the ppp but I would suggest that you add triggers to your 'recalculate' button that resets each of your variables to '0.00' when the user clicks on it to ensure that you really are starting from scratch again.

1 thing to remember is that you will want these new triggers above the trigger that takes you back to the first slide as SL executes triggers from top to bottom so you want the variables to be reset before you start again.

I hope this helps

Hassan Mujtaba

Hi Paul,

Please see the attached SL file. It has two slides, on the first one, there is a field to Enter the Cost. And  the second one, cost per person is displayed based on number of student.  The recalculate button is just sort of reloading the slide and not doing any calculation. In this example, the cost per person changes if total cost is changed. 

If this is not what you are trying to do, would it be possible to upload an example file so that we can have a look. As Antony said, without the slide it is kind of hard to diagnose the problem. 

Thanks,

Hassan 

Paul Brennan

Anthony/Hassan,

Thanks to your help I have managed to sort it. I tried resetting all the variables back to zero on the recalculate button but was still having problems, then checked out hassans Cost Calculation story and noticed that hassan had used equals Training Cost variable whereas I had used add Training Cost variable.

Appreciate the help guys

Paul

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