Millisecond Forums

Randomising radiobutton/checkbox option order on each trial

https://forums.millisecond.com/Topic29137.aspx

By lachie.kay1 - 5/28/2020

Hi,

Quick question here:

<radiobuttons myradiobuttons>
/ caption = "mycaption"
/ options = ("option1"; "option2"; "option3")
/ order = random
/ required = true        
</radiobuttons>

this randomises the order of options for checkboxes/radiobuttons at the start of the script and then keeps this order each time the surverypage is presented.

Is there a way to randomise the order on every trial? So that each time the same surverypage is presented, the options are shuffled into a new order?

Thanks!
By Dave - 5/29/2020

lachie.kay1 - 5/29/2020
Hi,

Quick question here:

<radiobuttons myradiobuttons>
/ caption = "mycaption"
/ options = ("option1"; "option2"; "option3")
/ order = random
/ required = true        
</radiobuttons>

this randomises the order of options for checkboxes/radiobuttons at the start of the script and then keeps this order each time the surverypage is presented.

Is there a way to randomise the order on every trial? So that each time the same surverypage is presented, the options are shuffled into a new order?

Thanks!

You'll have to do something like this:

<list myoptions>
/ items = ("option 1", "option 2", "option 3")
/ selectionrate = always
</list>

<values>
/ a = ""
/ b = ""
/ c = ""
</values>

<surveypage mypage>
/ ontrialbegin = [
    values.a = list.myoptions.nextvalue;
    values.b = list.myoptions.nextvalue;
    values.c = list.myoptions.nextvalue;
]
/ questions = [1=myradiobuttons]
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<radiobuttons myradiobuttons>
/ caption = "mycaption"
/ options = ("<%values.a%>", "<%values.b%>", "<%values.c%>")
</radiobuttons>

<block myblock>
/ trials = [1-4 = mypage]
</block>

By lachie.kay1 - 5/30/2020

Thanks for the quick response! Worked like a charm