Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Setting a list and referencing it from a loop object

NaomiHavronNaomiHavron Posts: 3
edited February 12 in OpenSesame


I am pretty new to Open Sesame (and Python generally). I am trying to create a list, shuffled for each participants, then continuously reference it from different loops throughout the experiment. I need this so that an item which appeared in one block or trial type will be poped and not displayed again in another routine. I tried doing this with an inline in the beginning of the experiment (var.target = [1,2,3,4]) shuffle(var.tagret)) - but how do I get my experimental objects to recognize that [target] is a variable? it's not in the variable list.
I also tried, rather than using an inline, embedding my different loops within a bigger loop which contains this list - so that all my routines are contained within it and reference the same list - but this doesn't work either.
What would be the smartest simplest way to do this?

Additionally, I want to set [target] to be different depending on experimental condition. I tried to define this in an inline either in the beginning of the experiment, or within the loop which contains a table with [target] or contains [noun] and [verb] - which are the targets for the different groups - but none of these options work.
Again, there must be a super easy way I am missing :smile:

Here's what I tried:

if var.subject_nr%2 == 1:
    var.group = 'verb'
    var.group = 'noun'

##define stimuli for group  
if var.group == 'verb':
    var.target = var.verb   #var.verb could be defined through a list in the inline or a table, I tried both
    var.dist = var.noun
    var.target = var.noun
    var.dist = var.verb

Thanks in advance!!

Sign In or Register to comment.