How to calculate the score with number variable when users change the selection

Nov 04, 2022

Hi Dear Articulate Community,

 

I am using number variable for a self-assessment. So different scores will be added to the number variable when learners make their selection (i.e. no pain = add 0, somewhat painful = add 1, so much pain = add 2). I have sed groups buttons to prevent learners from make multiple selection for each self-assessment items. But the problem is, when learner change their selection from somewhat painful (add 1 to the variable) to so much pain (add 2 to the variable), 2 will be added to the number variable in addition to the previous 1.

I am wondering is there anyway to prevent learner from changing their selection, or if they change their selection, is there anyway to make the variable accurately calculate the value? I am attaching a quick prototype that tells the problem. 

4 Replies
Justin Collinge

Hi Erin

I had a similar problem with one of my projects & the simple answer (Though a bit of a pain to re-program) was to put the calculation onto a 'next' button. So all the choice buttons simply 'set' the variable to that chosen number. Then you're not adding anything when they change their selection. 

DM me if you want to see it in action.

Good luck!

Justin 

Erin Gao

Hi Justin,

Thanks for your response! Much appreciated! Actually I set it up as add value X to the variable when user clicks next button on the condition that if a state of a button is selected. But it seems storyline didn't execute the calculation (trigger)....I am attaching the testing slide here. Would you mind taking a quick look to see whether I am missing anything here? 

Millions of thanks for your help!!

Justin Collinge

Hi Erin

Happy to help. You can see my example in action here - https://360.articulate.com/review/content/302f2197-5dd8-4ab8-a71c-d8f5faf9a4e4/review I've shown the current scores for each variable so you can track what's going on - they aren't there in the finished version.

I've attached the SL file so you can see the triggers used to do it.

This is the process:

(1) A variable is assigned a score depending on which button is clicked (Using a button set for each set)

(2) ONLY when 'submit' button is clicked is that score added to another variable which keeps a total - this avoids people adding on extra amounts if they click other buttons

(3) As the next page the clickable variables are all sent back to zero, ready for the next input- the total variables stay the same ready for this new next page's results to be added when the 'submit' button is pressed

I also included the results page to show how I show results for this sort of survey (Please note I've only included a couple of the 5 pages of questions & have taken out all of the explanation & application that came at the end of this)

Let me know how you get on. And feel free to ask if this doesn't make sense! 😜

Justin 

Justin Collinge

Sorry - didn't read your question properly! In answer to what you actually asked rather than what I thought you asked! 🙄😂 ...

Virtually everything you've done looks right - the reason it's not working is the order of the triggers. You need to put the 'Jump to next slide' trigger underneath all of the other ones or it jumps to slide 2 before running the other triggers!

I can't tell you how many times I've done exactly that mistake!