Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Randomising a widget response page

I need to randomise the widget response page of my experiment. I currently have this code in place and it works perfectly:

set timeout infinite
set spacing 25
set rows "1;1;1;1"
set question "Select the black and white animal you saw. Or select 'don't know'"
set options "draw image center=1 file=c_bird.jpg scale=1 show_if=always"
set only_render no
set margins "50;100;50;100"
set form_var response
set form_title "Form title"
set description "A simple multiple choice item"
set cols "1;1"
set button_text Ok
set allow_multiple no
set advance_immediately yes
set theme gray
widget 0 0 2 1 label text="Target selection"
widget 0 1 2 1 label center=no text="Select which black and white animal you saw or if you don't know select 'don't know' "
widget 0 2 1 1 image_button path="bw[T1].jpg"
widget 1 2 1 1 image_button path="bw_[picture3].jpg"
widget 0 3 1 1 image_button path="bw_[picture2].jpg"
widget 1 3 1 1 button text="Don't know"

How can I adapt this code so that it randomises the order my widget buttons appear on the screen? At the moment the right answer is always the first button [T1].

Thanks,
Jenny

Comments

  • KnanteKnante Posts: 144

    Hi Jenny,

    You can randomise the order of the buttons by turning the positions, meaning the column and/or the row, of the buttons into variables (e.g. widget 0 [positions_row] 1 1 image_button path="bw[T1].jpg"). These variables can be created in a loop somewhere in your experiment.

    For more information, please refer to this thread:

    Best,
    Laurent

  • jennzy11jennzy11 Posts: 6
    edited March 7

    Thanks Laurent,
    I have now adjusted my code and created the variables in a loop relevant to the rows and columns on my form so it looks like this:
    widget 0 0 2 1 label text="Target selection"
    widget 0 1 2 1 label center=no text="Select which black and white animal you saw or if you don't know select 'don't know' "
    widget "[pos_col]" "[pos_row]" 1 1 image_button image_id="[position]" path="bw_[T1].jpg"
    widget "[pos_col]" "[pos_row]" 1 1 image_button image_id="[position2]" path="bw_[picture3].jpg"
    widget "[pos_col]" "[pos_row]" 1 1 image_button image_id="[position3]" path="bw_[picture2].jpg"
    widget 1 3 1 1 button text="Don't know"

    However, I am now just getting one picture in a random position on the screen instead of 3 random pictures. How can I rectify this?

    Jenny

  • KnanteKnante Posts: 144

    Hi Jenny,

    I'm not sure what the problem is, would you mind sharing your experiment so i can have a look at it?

  • jennzy11jennzy11 Posts: 6

    Thanks so much for taking a look. The issue is on the widget page in which participants have to select their answer. I need the correct answer to display and then two random pictures also. However, it also can't display the same picture twice on the page otherwise it will be confusing for them.

  • KnanteKnante Posts: 144

    Hi Jenny,

    Attached is the experiment, it should display three option now. What happened was that the answer options (the widgets) were allocated to the same location within a trial, resulting only in a single option. I have changed the widget_loop so that all location are unique (note that there are only 6 possible combinations). Furthermore, it was not necessary to include additional location variables so i have removed them to avoid confusion.

    What still needs to be done though, is making sure that the answer options do no display the same alternative twice (i.e. when your target is the same as one of the stimuli in your RSVP). I think you can achieve this by merging the block_loop with the picture_loop. Since the target is assigned in the former, you can manually decide which of the alternatives in your RSVP should be left out and add the remaining stimuli to the loop.

    Let me know if that helped!

  • jennzy11jennzy11 Posts: 6

    That is perfect! When I ran it again it selected the same T1 6 times because of the widget loop so I have just merged that too so my block loop has lots of variables in it but will work the data out later!

    Thank you so much for your help and patience, you have literally saved my degree!

Sign In or Register to comment.