Add new item in sketchpad
I have designed an experiment that goes as such:
- I have a pool of 5 stimuli (pictures).
- Show me predefined triplets of those stimuli in random order (The triplets are all defined in a loop item before the presentation sketchpads.).
- After the presentation of the triplet, I want to show again one of the pictures, selected randomly.
I have done steps 1 and 2. I am completely stuck in step 3.... I added a python script before the last sketchpad and I have written this:
options_cvg = [ var.castanets, var.violin, var.guitar ] #these are the possible options of stimuli you can show me if the triplet is the triplet named 'cvg'
if var.sequence == 'cvg': #if the sequence is the sequence named 'cvg'
var.lab1 = random.choice(options_cvg) #then make the variable named lab1 be a random choice of the possible options
Then I added a sketchpad and wrote the following:
draw image center=1 file=var.lab1 scale=1 show_if=True x=-288 y=-192 z_index=0
However, it doesn't run and I keep getting error messages. Where should I define the var.lab1 variable?