Hi Jens,
So there are multiple spots that do this, since I have the grid in the instructions, and in three separate blocks of N-Back tasks.
The first instructions:
InstructionsClock = core.Clock()
instructions = visual.TextStim(win=win, name='instructions',
text='Welcome to the experiment!\n\nIn this task you will be presented with a 3 x 3 grid of squares. These squares will appear like this:',
font='Arial',
pos=(0, 0), height=0.05, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=0.0);
image_3 = visual.ImageStim(
win=win,
name='image_3',
image='resources/grid.png', mask=None,
ori=0.0, pos=(0, 0), size=(0.6, 0.6),
color=[1,1,1], colorSpace='rgb', opacity=None,
flipHoriz=False, flipVert=False,
texRes=128.0, interpolate=True, depth=-1.0)
Then, the instructions give a visual example of what the white squares will look like. Incidentally, the error does not actually occur within this code for some reason. It’s only once it gets into the first N-Back experiment.
instructions_3Clock = core.Clock()
text = visual.TextStim(win=win, name='text',
text='In this task, white squares will appear within this grid, like this:',
font='Open Sans',
pos=(0, 0), height=0.05, wrapWidth=None, ori=0.0,
color='white', colorSpace='rgb', opacity=None,
languageStyle='LTR',
depth=0.0);
polygon = visual.Rect(
win=win, name='polygon',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0.0, pos=(-0.2, 0.2),
lineWidth=1.0, colorSpace='rgb', lineColor=None, fillColor=[1.000, 1.000, 1.000],
opacity=None, depth=-1.0, interpolate=True)
polygon_2 = visual.Rect(
win=win, name='polygon_2',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0.0, pos=(0, 0.2),
lineWidth=1.0, colorSpace='rgb', lineColor=None, fillColor=[1.000, 1.000, 1.000],
opacity=None, depth=-2.0, interpolate=True)
image_2 = visual.ImageStim(
win=win,
name='image_2',
image='resources/grid.png', mask=None,
ori=0.0, pos=(0, 0), size=(0.6, 0.6),
color=[1,1,1], colorSpace='rgb', opacity=1.0,
flipHoriz=False, flipVert=False,
texRes=128.0, interpolate=True, depth=-3.0)
polygon_3 = visual.Rect(
win=win, name='polygon_3',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0.0, pos=(0.2, 0.2),
lineWidth=1.0, colorSpace='rgb', lineColor=None, fillColor=[1.000, 1.000, 1.000],
opacity=None, depth=-4.0, interpolate=True)
polygon_4 = visual.Rect(
win=win, name='polygon_4',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0.0, pos=(-0.2, 0),
lineWidth=1.0, colorSpace='rgb', lineColor=None, fillColor=[1.000,1.000,1.000],
opacity=None, depth=-5.0, interpolate=True)
polygon_5 = visual.Rect(
win=win, name='polygon_5',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0.0, pos=(0, 0),
lineWidth=1.0, colorSpace='rgb', lineColor=None, fillColor=[1.000,1.000,1.000],
opacity=None, depth=-6.0, interpolate=True)
polygon_6 = visual.Rect(
win=win, name='polygon_6',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0.0, pos=(0.2, 0),
lineWidth=1.0, colorSpace='rgb', lineColor=None, fillColor=[1.000,1.000,1.000],
opacity=None, depth=-7.0, interpolate=True)
polygon_7 = visual.Rect(
win=win, name='polygon_7',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0.0, pos=(-0.2, -0.2),
lineWidth=1.0, colorSpace='rgb', lineColor=None, fillColor=[1.000,1.000,1.000],
opacity=None, depth=-8.0, interpolate=True)
polygon_8 = visual.Rect(
win=win, name='polygon_8',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0.0, pos=(0, -0.2),
lineWidth=1.0, colorSpace='rgb', lineColor=None, fillColor=[1.000,1.000,1.000],
opacity=None, depth=-9.0, interpolate=True)
polygon_9 = visual.Rect(
win=win, name='polygon_9',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0.0, pos=(0.2, -0.2),
lineWidth=1.0, colorSpace='rgb', lineColor=None, fillColor=[1.000,1.000,1.000],
opacity=None, depth=-10.0, interpolate=True)
text_2 = visual.TextStim(win=win, name='text_2',
text='During this task, the white squares will appear at different locations. Sometimes the squares will appear in the same location consecutively. You will be required to press the SPACEBAR if the white square appears in the same place consecutively. For example if the square was in the left down corner on trial 1 and then it appeared in the same location on trial 2, press SPACEBAR. Otherwise, do not respond. If you have understood these instructions, press the SPACEBAR to continue.\n\nNote that if you wish to abort this study at any time, you can do so by pressing the ESC key.',
font='Open Sans',
pos=(0, 0), height=0.04, wrapWidth=None, ori=0.0,
color='white', colorSpace='rgb', opacity=None,
languageStyle='LTR',
depth=-11.0);
key_resp = keyboard.Keyboard()
This is where the error starts:
N_back_1_TrialClock = core.Clock()
grid_lines = visual.ImageStim(
win=win,
name='grid_lines',
image='resources/grid.png', mask=None,
ori=0, pos=(0, 0), size=(0.6, 0.6),
color=[1,1,1], colorSpace='rgb', opacity=1,
flipHoriz=False, flipVert=False,
texRes=128, interpolate=True, depth=0.0)
target_square = visual.Rect(
win=win, name='target_square',
width=(0.15, 0.15)[0], height=(0.15, 0.15)[1],
ori=0, pos=[0,0],
lineWidth=1, colorSpace='rgb', lineColor=None, fillColor=[1.000,1.000,1.000],
opacity=1, depth=-1.0, interpolate=True)
fixation_2 = visual.TextStim(win=win, name='fixation_2',
text='+',
font='Arial',
pos=(0, 0), height=0.05, wrapWidth=None, ori=0,
color='white', colorSpace='rgb', opacity=1,
languageStyle='LTR',
depth=-2.0);
response = keyboard.Keyboard()
Something that I noticed is that in builder, I have it set up so that the position = $location, as defined by the excel spreadsheets that I’m using. But in this, the code is working out to pos=[0,0].