sequential and random variables in loop
hi all, i am looking to create both random and sequential variables in a loop.
e.g. i will have 5 trials, each trial has a fixation cross followed by a random letter as a stimulus. however, i have a fixed sequence for how long the cross is presented for - i.e. first trial 30s, 2nd trial 5s, 3rd trial 25s, then 4th trial 10s and 5th trial 15s - in that exact order.
is it possible for me to set in the loop such that I can randomly present a stimulus, but at the same time, have a fixed sequence of timings of how long the cross is presented?
Comments
Hi @carrot44,
In order to achieve what you're after, you'll have to use some code (Python or Javascript if you're running your experiment in OS, and Javascript if you're aiming to run it with OSWeb).
The general idea is to declare an array where the elements to be randomized are stored, shuffle it (if need be applying some conditions), and then output them to the loop as the task runs.
Have a look at these examples to see how this works: https://forum.cogsci.nl/discussion/comment/23977#Comment_23977, https://forum.cogsci.nl/discussion/comment/24005#Comment_24005, https://forum.cogsci.nl/discussion/comment/23974#Comment_23974
Hope this helps,
Fabrice.