Calculator in Storyline

Posted Thursday, January 10, 2013 at 10:26 AM  

So I've been building a calculator in Storyline that allows the learned to input a value and press submit to see how much they spend on each item per week. Once all Submit buttons are clicked, a new layer appears that divided the yearly total by 2 so the learner can see how much they could save. 

 

However, while i have almost everything working, I need a little bit of advice on the division at the end. Anyone have any comments?

 

I have attached the file to this post. 


Calculator_Michelle_v3.story

This post has 1 verified answers

Verified Answers

User Rank Phil Mayor

9,729 posts

Posted Thursday, January 10, 2013 at 12:44 PM  

Verified Answer

I think this is working.

 

I rebuilt it onto the buttons.

 

I think the problem was using the visited state to show the layer, because this happened before your calculations, trigger order is important so the layer was showing before a calculation took place


All Replies

Posted Thursday, January 10, 2013 at 11:41 AM  

Hi Michelle,

 

I like what you've done here. I've played with a for a bit, and am seeing that it seems to work some clicking sequences and not in others.To try to tease it out, I put a FINAL reference in a text box on the Final layer, to see if that was causing the problem. And I think it might be.

 

I need to run out now, and I haven't quite figured out WHERE it is, but:

  • Let' say I leave all items blank (set to 0) EXCEPT for personal gifts and clothing, and for purchases per week I type in a 1.
  • And, let's call the Submit buttons from left to right (in preview mode) Submit 1, 2, 3, 4
  • If I click Submit 1, then Submit 2, then Submit 3, then Submit 4, the Final (in the reference box I've placed on the layer) Shows as 0.
  • But, if I click Submit in other sequences, e.g., 2, 3, 4, 1 or 3, 4 1, 2 or 2, 4, 3, 1. Final (the tota)l displays correctly.

When I play with the other items I yield similar results but with different sequences of clicking Submit buttons. Pretty much, it seems if I  first hit the Submit button that comes AFTER an item, that item's "full" reference shows as 0.

 

So, I I only enter a quantity in one of the boxes and:

So for iTunes, if I hit Submit 2, 3, 4, 1, Full = 0.

For Coffee if I hit Submit 3, 4, 1, 2, Full=0

For Lunch if I hit Submit 4, 1, 2, 3, then Full = 0

 

Wish I had another few minutes. Curious now!


User Rank Phil Mayor

9,729 posts

Posted Thursday, January 10, 2013 at 11:55 AM  

IT seems a slightly strange way to do it using slide level triggers for your calculations, there is something strange going on that i cannot see, your total is not adding up correctly and I really cannot see why.  Sorry the problem is not the divide you total is off before the divide


Posted Thursday, January 10, 2013 at 12:02 PM  

Rebecca - 

 

Perhaps, as Phil pointed out, the route would be better if I didn't have slide level triggers and instead had all things happen on one base layer. Perhaps that is what is causing the addition to be skewed. 

 

If I were to hypothetically place all triggers on the base layer, would the amount of triggers and variable on one base layer affect the overall outcome?

 

I have a fear that certain things are cancelling out. 

 

It is doing the math correctly when you enter a number in the top row of boxes and press submit and the correct answer appears in the second row of boxes. (See screen shot). I just don't know why the addition after those populate is incorrect.


Correct Calculations from Flash Course.png
User Rank Phil Mayor

9,729 posts

Posted Thursday, January 10, 2013 at 12:05 PM  

I would put most of the action triggers on the buttons and the calculate triggers elsewhere.

 

I have to be really honest this felt so strange to me I started rebuilding the whole thing and then ran out of time.

 

The initial calculations are correct, if you remove the divide trigger the total is one box short (I think the last one you press) but I dont know why

 

But that is where the problem is.  To debug this i would need to delete the triggers and start again just because this isnt how I would build it and it is making my head hurt


Posted Thursday, January 10, 2013 at 12:10 PM  

this is the first calculator i've built is Storyline so I don't really know the best practices. 

 

Any tips for the future?


User Rank Phil Mayor

9,729 posts

Posted Thursday, January 10, 2013 at 12:21 PM  

Hi Michelle

 

First there is no right or wrong way and looking at it, I am sure it should work your way.  It is just not the way I would do it.

 

I would add all of the logic on the submit buttons, including the show layer trigger.  I would exactly the same as you add the calcuations for the total I would add to the layer as timeline start triggers.

 

It all works but there is something strange that I feel I am missing somewhere and cannot get it (this is frustrating me).

 

Your way probably uses a few less triggers, I think


Posted Thursday, January 10, 2013 at 12:33 PM  

If it helps, the calculations I was using are as follows:

 

iTunes is approximately 0.99/purchase and so i multiplied this by the number entered in the first row.

Lunch was 8.99 and thus that got multiplied by what was entered in the data entry.

Coffee was approximately 2.95 and was multiplied by the number entered.

Gifts was 25 and multiplied by the data entry. 

 

Therefore, all the math to get the second row correct was good, so it has to be something happening during that or after. 

 

(hurts my head to!)

 

 


User Rank Phil Mayor

9,729 posts

Posted Thursday, January 10, 2013 at 12:34 PM  

I will have a nother look, just one thing I have noted you do not need a trigger to set an object to visited that is automatic


Posted Thursday, January 10, 2013 at 12:44 PM  

ha I have like PTSD from triggers. I had a rough patch where the visited state wouldn't work without a trigger on images. So now I add it to be safe. 


User Rank Phil Mayor

9,729 posts

Posted Thursday, January 10, 2013 at 12:44 PM  

Verified Answer

I think this is working.

 

I rebuilt it onto the buttons.

 

I think the problem was using the visited state to show the layer, because this happened before your calculations, trigger order is important so the layer was showing before a calculation took place


Calculator_Michelle_v3.story
User Rank Phil Mayor

9,729 posts

Posted Thursday, January 10, 2013 at 12:46 PM  

the calculation then happened after the layer showed but at this point it was too late and the total calculation had already happened


Posted Thursday, January 10, 2013 at 12:49 PM  

Phil, 

 

you're a genius. This works perfect. I didn't realize that order mattered as much as it does. You taught me two things in one day. Thanks!


Posted Thursday, January 10, 2013 at 2:44 PM  

Wow, Phil! I was out on errands and couldn't wait to get back and see what happened with this (geeky, eh? ). Awesome!


User Rank Phil Mayor

9,729 posts

Posted Thursday, January 10, 2013 at 11:58 PM  

I couldn't let this one go, I tried but Michelle was persistent, I also had this nagging voice in my head saying "why can't you do it"

 

i am happy now


Posted Friday, January 11, 2013 at 7:45 AM  

I know what you mean. Tx for not letting it go. I learned a lot from it thanks to you and Michelle. 

 

Michelle, you did things with variable calculations that I hadn't thought of before. And Phil, well, as you saw from my post, I could see that something wasn't firing correctly and it was very "specific" in sequence, but I would never have determined what it was.

 

I also recreated it, for the sake of practice and because I had some ideas about what I would need to see as a Learner - this is me, not everyone - that would make the math more concrete for me. But, I did it with only 2 items for the sake of time. In fact, I don't really HAVE the time to do this now! But I was so intrigued and I so very much liked what Michelle had started.

 

I''m attaching here, just for the sake of sharing. I think it all works. I tried it in different sequences: just the item on the left, just the one on the right, left first, right first...

 

Thanks again to both of you! Signing off now.


Calculator_Michelle_v3_pm+rfc.story

Posted Friday, January 11, 2013 at 8:40 AM  

Very cool!  I haven't worked much with calculations and displaying variables, and this taught me a lot.

 

One note viewing it for the first time (design thing), I really thought it was a bug that the submit buttons disappeared.  I was wanting to change my number and couldn't.  Having it disappear really seemed abrupt.  Anyway you decide to design it, great job!


Posted Friday, January 11, 2013 at 8:46 AM  

I appreciate everyone's input. 

We had the Submit button disappear as a request, but i do agrtee as a best practice not to so the learner can play around with different options.

 

Thanks community!