Presenting sets with random number of stimuli in random order
Hello to all,
I need some help. I am trying to build an experiment in which 5 sets of pictures will be presented in a very fast pace (0.3 second each picture). Thing is, I want the order of the pictures to be random and the order of the sets to be random as well. In addition, the sets are to be created from 2 different categories, each set with a random number of stimuli from each category (for instance, 8 from A 10 from B, 6 from A 5 from B, etc.), although the number cannot be too small (say min 4). Does anyone have an idea how to do this?
Thanks in advanced
Amihai
Comments
Any help?
I have done some progress and have another question: Is there a way to run less cycles than the variable levels in a loop? meaning the loop will choose randomly from the levels.
I tried putting [a variable] in the cycles number but got an error.
Hi Amihai,
Have you already solved the randomization problem?
Yes! In the
loopitem there is an advanced options checkbox. If you enable it, you can set a value for abreak iffield. In this field, you can add variable names.Does this make sense?
Eduard
Dear Eduard,
I solved part of the randomization problem using loop functions.
I was thinking to use the "less cycles than the variable levels in a loop" solution to randomize the number of stimuli from each category (although not an elegant solution..).
Do you know how could I use the Break if check box to do this?
And thanks for your help.
Amihai
Hi Amihai,
you could use a counter variable and break the
loop(with thebreak_iffield), once the variable has a certain value. So, if you have aloopthat supposed to have 15 trials, you add aninline_scriptto yourtrial_sequence, in which you increment the variable by one (counter += 1).Does something like that work for you?
Good luck,
Eduard
btw. sorry for the late reply!
Dear Eduard (or anyone else who can help),
Thank you very much for your replay. I used your tip and eventually managed to find a plausible solution. Yet, now I have another problem: I need to log the pictures that were eventually presented in the loop from the total number of possible pictures. The output file does not give me this information. Is there a way to do this?
Thanks you
Amihai
Hi Amihai,
All exp.variables are automatically logged by the log item, so all you have to do is to store the picture names in a few variables.
Say you have a picture list as follows:
pictures = ['1.jpg','2.jpg','3.jpg'], shuffled withrandom.shuffle(pictures). Now you can log them as follows:Hope this hepls.
Cheers,
Josh
Hi Josh,
First of all, thank you.
Secondly, I did not understand your answer. I am using a loop function to randomly show the pictures from a variable list with the pictures names. I have two categories of pictures so to randomly show a different proportion from each category I used the "less cycles than the variable levels in a loop" option (see above). How can I know which pictures were eventually shown?
Amihai
Still no luck.
doed any one have an idea how to solve this?
Hi Amihai,
What I suggested requires the use of an inline_script item. You can place that thing somewhere in your trial sequence. I also assume that your pictures have names, right? (e.g. '1.jpg'). As soon as the picture for your trial is specified, you can log it.
Cheers,
Josh
Hi Josh,
I am using the sketchpad to display the images from the loop function.
This is the text from the sketchpad script:
set duration "[duration]"
set description "Displays stimuli"
draw image center=1 file="[words]" scale=1 show_if=always x=0 y=0 z_index=0
How can i log the image from this?
And thank you very much for your help
Amihai