URL of experiment:
https://run.pavlovia.org/hij113/tdlpl/html
Description of the problem:
Hi, everyone. I am looking for your wisdom to solve my problem that lasted several days… I am naive to python and psychJS languages so I cannot find where the error is.
This is my experimental design: Search display consists of 11 homogenous shape items (hexagon or octagon) and 1 singleton shape item (target; octagon or hexagon, opposite shape to homogenous shape). Sometimes, one homogenous shape item can appear with a different color or not (distractor). So, there should be only one singleton shape item regardless of the presence of singleton color item (because the shape of singleton color item is always the same to 11 homogenous shape items).
I defined the shape, color, location, … relevant variables and checked in the java console that the variables are well-defined.
This is the problem: Sometimes, the search display does not match with the defined variables. 1) While the homogenous shape is hexagon and the singleton shape is octagon, the display shows the opposite. 2) Sometimes, the target and the distractor are in the same shape, which should not.
I create the hexagon or octagon polygons by manipulating the opacity according to the pre-defined variables. The opacity parameter seems well-defined but it seems not well adjusted when creating visual stimulus.
The structure of my code: I first of all draw 12 hexagons and 12 octagons, and changed the opacity to show either hexagon set or octagon set every trial. To draw the target, I overlaied a buffer square on one possible item location, then draw either the octagon or hexagon target on it. To draw the distractor, I also overlayed a buffer square on one possible item location, then draw either the hexagon or octagon distractor with different color on the buffer. All the opacities are controlled via the code below.
if shapeT == 6: #shapeT = homogenous shape
hexagon = 1
octagon = 0
elif shapeT == 8:
hexagon = 0
octagon = 1
I attached the gitlab and experiment urls above. I also attached py file for those who are familiar with python lines (the python code was created by psychopy program. The experiment was created with builder but most of the parameters are defined with code components). For your easy referencing, polygon drawing begins from line 226 to line 769, and variable settings begin from line 1213 to 1435.
Please share your wisdom for me…!!!
distSL_py.py (150.3 KB)
distSL_py.psyexp (143.5 KB)