URL of experiment: corsi [PsychoPy]
Leonardo Bernardino / corsileo · GitLab
Description of the problem: I’m using a version of the Corsi blocks task with a 4 x 4 grid of blocks to click on (downloaded from experiments’ page). So, I’m using Builder as I don’t have skills to code
It works in my computer (PsychoPy 2020.2.10), but when I try to run online, I get this error message.
There’s a code component (updateBlocks) with the following properties:
Begin Routine
# initial state
blkIndex = 0
nextSwitch = blockDuration
doingResponse = False
currBlock = None
# store blocks as a dictionary (to switch between name/object)
blocks = {}
blocks['blk1']=blk1
blocks['blk2']=blk2
blocks['blk3']=blk3
blocks['blk4']=blk4
blocks['blk5']=blk5
blocks['blk6']=blk6
blocks['blk7']=blk7
blocks['blk8']=blk8
blocks['blk9']=blk9
blocks['blk10']=blk10
blocks['blk11']=blk11
blocks['blk12']=blk12
blocks['blk13']=blk13
blocks['blk14']=blk14
blocks['blk15']=blk15
blocks['blk16']=blk16
for blockName in blocks:
blocks[blockName].color="white"
Each Frame
if not doingResponse and t > nextSwitch:
if currBlock is not None:
#reset color of current block
currBlock.color = 'white'
# then change current block and make that red
if blkIndex >= len(sequence):
doingResponse = True # no more blocks to show
else:
currBlockName = sequence[blkIndex]
currBlock = blocks[currBlockName]
currBlock.color = 'red'
# track time of this change
nextSwitch += blockDuration
blkIndex += 1
# all clicked?
if len(mouse.clicked_name) >= len(sequence):
continueRoutine = False
# update color of clicked
for blockName in mouse.clicked_name:
blocks[blockName].color = 'darkgrey'
Anyone could help me? Thanks in advance