Using variables in a loop to define trial stimulus
Hi, I am trying to create an experiment where a series of videos are shown in a random order. However the videos are in pairs and these pairs must always appear together. Additionally, once the order has been set, the videos need to be shown again in the same order. My sequence looks like this:

At the end of the loop there will be a conditional where if participants do not reach a particular performance then the loop is repeated (but in the same order as before).
To do this I have tried to define the order using an inline script at the beginning of the experiment. The names of the video files are identical to the videos I have in the file pool:

And then call the videos in the loop like so:

However I am getting this error:

I have no experience with Python (or with any programming language really) so I am not sure where I am going wrong or if what I am trying to do is even possible.
Comments
Hi,
OpenSesame doesn't understand
lists when using the square-bracket notation. So this:[order[1][1]]means nothing to OpenSesame, and is therefore just interpreted as a string of text. If you want to include Python statements in yourlooptable, you can do so by prefixing=. Like so:=order[1][1]. So that's where your error message comes from. See also:However, if you really don't know any Python, then you're in over your head here! And you will find yourself moving from problem to problem. If that's the case, I would first walk through at least the beginner and intermediate tutorials before you work on the experiment:
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan, thanks for your feedback - this is now working exactly how I wanted (with the additional alteration of my numbers due to Python counting the first item in a list as 0)
Thanks for the links, I will go through them.