Choosing one of a few equal variables

Mar 10, 2015

Hi there,

I have built a test with 17 multiple choice questions. I have 7 numerical variables defined and the answers chosen in the test questions are tracked with these. When a user chooses a certain answer, a certain variable goes up in value. The variables are increased by 1/2/3, weighted according to question.

I have 7 results slides based on these 7 variables, and in the end I show the result slide for the variable that has received the highest score. The problem I have is what to do when more than one variable reaches the same value.

Say for instance, that my variables are aa, bb, cc, dd, ee, ff, gg and these are my results:
aa = 12
bb = 9
cc = 7
dd = 11
ee = 12
ff = 12

How can define a condition so that one of aa, ee and ff is picked and the user goes to one of those results slides? I would have wanted to do this randomly but I don't think that is an option. So far I have been using the "greater than" condition, and the "greater than or equal to" condition has not worked.  Any suggestions?

1 Reply
Alexandros Anoyatis

You could theoretically test each result variable value against each other and come up with a "winning" slide (which will likely be the last to satisfy your condition, so not exactly random), but the cleanest way is to use one single Javascript trigger, move the values inside an array, then pick the highest one (or three in this case), and finally choose one of these at random and assign it back with a Setvar to a separate variable.

Hope this helps,
Alex

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