Shuffling Answers

Jul 12, 2013

Hi everyone!

I'm creating an assessment with Storyline and I have a question about shuffling answers. I'd like to put more than one question on a slide, and be able to shuffle particular answers that are in a row, but not with the others if that makes sense..

So in this case:

1. Cat, Dog, Bird

2. Orange, Apple, Banana

I want to shuffle cat/dog/bird among themselves and then shuffle orange/apple/banana amongst themselves. Is there any way I can do this with storyline?

Thanks!

Daniela

6 Replies
Alexandros Anoyatis

Hi Daniela,

Off the top of my head :

1)
Create a numeric variable (say "ccb") for the first group.
2) Create a numeric variable (say "oab") for the second group.

3) Create the same identical states for each answer (say 1, 2 & 3) of each group.

4) Execute Javascript to select and assign a number from 1 to 6 for "ccb" and "oab" (see this for details how to). The reason for this is that there are only 6 variations in this case.
5) Make a note of each individual result :
i.e.: 1 is Cat, Dog, Bird ,
2 is Cat, Bird, Dog,

3 is Bird, Dog, Cat,

4 is  Bird, Cat, Dog

5 is Dog, Bird, Cat

6 is Dog, Cat, Bird


The same stands for group 2.


6)
Create 3x triggers in the form of
If ccb=1 then change state of answer 1A to state 1 (whichever is Cat)

If ccb=1 then change state of answer 1A to state 2 (whichever is Dog)

If ccb=1 then change state of answer 1A to state 3 (whichever is Bird)


Same for the next 5 variations

That's a whole lot of triggers (not to mention the additional ones you will have to use in order to calculate the answers), but I believe it works.

I'm pretty sure there's a much more efficient way of doing this, but it's Saturday and my brain is on idle today...

Hope this helps,
Alex

EDIT : If your JS is "up to par", you could just randomise an array [0,1,2] and assign the randomised values to variables (3 for each group of answers this time). This way, you'd only have to use 9(3x3) triggers for each group, instead of 18 (3x6) for each group.

Daniela Schiano di Cola

Wow, thanks so much for the response. It's a little over my head at this point, but I'm still trying to do it...I haven't used variables as much--how would I set the Operator, Value, When, and Object for each variable?

Otherwise--I think executing the JS would be quicker and better. Do you know a good resource to figure out how to write that code?

Alexandros Anoyatis

Hi Daniela,

You were certainly in the right path.

However,
A) You were executing Javascript twice and didn't use the correct syntax so the result was always 0.
B) You had some incorrect "When" actions in your triggers (some where set to "When timeline starts (correct)", but a couple where set to "when user clicks" (not correct).

Here is how I got it to work for both groups (see attached). It is done exactly like I described above, I just combined two "IF" statements for each state instead of creating a separate trigger. This way I managed to cut the trigger number to half.

Hope this helps,
Alex

P.S.: As I said earlier, this only randomises your 2 sets/groups of questions. It does not calculate the result, nor does it even "know" which one actually is the right answer. You will have to use additional triggers to make that happen.

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