Using "Skip" in a loop
Hi Forum,
We have a nested loop that we're going "in" and "out" of and are trying to have the nested loop to run in a sequence. Currently, it's repeatedly running the first item in the list over and over. So far we've tried to use the "skip" function and insert a "counter" to skip a given number of trials (n + 1 when n = number of trials completed). This led to the error: The value of skip is too high in loop item "deviant_trial_block1":: You cannot skip more cycles than there are.
Any help resolving this issue would be greatly appreciated.
Comments
Hi,
It is hard to tell what exactly went wrong without knowing the structure of your experiment. Would you mind uploading it? Or at least give a lot more information on your design/structure?
Thanks,
Eduard
Hi Eduard,
Thanks for the response. I'll try to be more clear on what the problem is. Our experimental setup is as follows:
This is what we want the experiment to look like:
We think the problem is that the nested list doesn't keep track (has no memory) for where the letter is in the sequence (if we put a flag down it repeatedly presents A, but if we have no flag and set are number of cycles to .02 times [so that the participants only see one item], the letters are randomly selected)
Any help is greatly appreciated!! We're stuck
Alright, I can see now.
I'm not sure how to fix this, while keeping your structure as is (i.e. skipping cycles is a tricky business, which I try to avoid as far as possible).
However, I think your goal can be rather easy accomplished, if you move most of your scripts into
inline_scripts. Such aninline_script(or ratherinline_scripts) would replace pretty much everything that is in your currenyloops (both of the nested ones). Below, there is a small example of how this could work. It is just a small demo, of course you would have to adjust it to make it do exactly what you want to.The first
inline_scriptcan be seen as a preparation in which you have to set the sequence in which you want to present stimuli. It needs to be placed outside thetrial_loop.Next, within the
trial_loop, you pick the current stimulus draw and present it:Does this make sense?
Eduard