Help! The trigger says add 8, but the system adds 12

I have created a slide that acts as a calculator (attached). If the user enters A, B, C, D or E for each Factor, the system is supposed to add a specific amount of points to the variable RGEGVaule. This variable, in turn, will display the associated grade based on a points range.

The user may than choose "Try Another" which tells the system to set the RGEGValue to 0 and blanks out the previous entries.

However, while the value for D is set to add 8 points in factors 1-3 and 16 points in factor 4 for a total of 40 points, the system appears to be adding 12 points for 1-3 and 24 points for factor 4.  And choosing try another does not seem to reliably set the RGEGValue back to zero.

Does anyone see what I'm missing?

10 Replies
Erika Anderson

Thank you, I agree it's broken. I was hoping someone would have some suggestions on how to fix it. I worked out that I have to set the RGEG Value variable to 0 before clearing the boxes and then that part seems more reliable, but it's still pulling 12 from some where, and that's not even an option.

Phil Mayor

I dont think it is evaluating the conditions. It may work if you have the score show only when you press calculate.

However there is a broken part of your design because you calculate on change I can type A in first box click outside and the click B and that will keep adding to the score that needs fixing.

My first solution would be to show a layer that runs the calculation when a variable change but that doesnt fix it (and it should). I wonder if case is broken oddly in the new trigger wizard i cannot set case.

See this file, this is how I would set it up (I have only done Factor 1) not sure if the two case triggers are necessary. 

Erin Sadler

Could you add the points to the variables when you click Calculate instead of when the value of the variables change? And just have the output trigger below those in the list, so it does the addition first?

Not that that would help the odd reset behaviours :-/

Edit: tried that, still pulling numbers out of its bottom!

Erin Sadler

Ok, I've very carefully built this up from the start. I've only added the first three text entry fields so far but it seems to be behaving as expected. From here you could add the other one, plus the state changing grade thingy?

I've made the adjustment of RGEGValue only happen when you click Calculate. There's also a hidden 'block' shape (opaque for testing, could be transparent) that stops users from editing the fields after clicking Calculate (until they click Clear). That should stop people futzing with the points :)

I've also added the T/F variable CalculateClicked which just changes to True when they click Calculate (and resets to False on Clear) - the triggers are conditional and will only add points to RGEGValue if CalculateClicked is false - just so they can't keep hammering the calculate button and incrementing the score.