Reply To: Creating visual stimuli from a csv

PennController for IBEX Forums Support Creating visual stimuli from a csv Reply To: Creating visual stimuli from a csv

#8019
florians
Moderator

You need to always have an image in each cell, whether it’s white or black, to keep the grid even. So introduce either white or black at first, and then hide previous and make new image visible in same location (black -> white or white -> black).

newImage(“sq1”, “black.png”)
,
newImage(“sq1b”, “white.png”)
,
newImage(“sq2a”, “white.png”)
,
newImage(“sq2”, “black.png”)
.hidden()
,
newCanvas(“grid”, 200,200)
// row 1
.add( 0, 0, row.r1c1==1?getImage(“sq1”):getImage(“sq1”) )
.add( 40, 0, getImage(“sq2a”))//row.r1c2==1?getImage(“sq2a”):getImage(“sq2a”) )
.add( 40, 0, getImage(“sq2”))//row.r1c2==1?getImage(“sq2”):getImage(“sq2”) )

[…]

getVar(“match”).test.is(“False”)
.success(getImage(“sq1”).hidden(), getImage(“sq1b”).visible(),getImage(“sq2a”).hidden(), getImage(“sq2”).visible())