[solved] Randomizing widgets
Hi there,
I developed a form_base where I display a picture of an emotion and four possible choices below it.
Since I plan on doing 40 trials, is there any way I can randomize the order of the choices.
This is the script for my form base:
set margins "50;100;50;100"
set rows "4;1;1"
set spacing "10"
set cols "1;1;1;1"
widget 0 0 4 2 image path="[facestims]"
widget 0 2 1 1 button var="e_happy" text="Happy"
widget 1 2 1 1 button var="e_sad" text="Sad"
widget 2 2 1 1 button var="e_angry" text="Angry"
widget 3 2 1 1 button var="e_fearful" text="Fearful"
Thanks in advance.
-Rose
Comments
hi
I used inline instead of form base
just replace the form base with this inline
the image widget is commented because I am not sure of it
but the buttons work fine
http://pastebin.com/cgMGUKip
Dror
Hi drorgarbi,
Thanks for the quick reply!
I tried the inline script you provide, but when I run the experiment this error message comes up:
Error: Inline script error
In: inline_script (run phase)
File "dist\libopensesame\item.py", line 432, in get
Python traceback:
runtime_error: Error: Runtime error
Description: Variable '' is not set in item 'inline_script'.
You are trying to use a variable that does not exist. Make sure that you have spelled and capitalized the variable name correctly. You may wish to use the variable inspector (Control + I) to find the intended variable.
Full traceback in debug window
Also, the pictures don't show, just the buttons.
The pictures are in the experimental loop under the following variable name: facestims
Here's the script that I am using: http://pastebin.com/ZeghQVvD
hi
this is the new inline with the images working
just paste this script in the run phase of the inlinescript
and put the inline object in a loop that has the facestims var with all the images as values.
the error is from the form start time line, I fixed it and placed it in the right place
http://pastebin.com/bAQJCX04
Thank you so much drorgarbi!
It works like a charm
For future reference, I made a slight change under "#Create five widgets" so I could record the participant's response http://pastebin.com/z4ay7Vh4
Again, thank you.