我的任务是多对象跟踪任务的变体。屏幕上有7个圆圈。它随机选择 3 个圆圈来短暂更改颜色(红色、绿色、蓝色),以指示参与者跟踪这些圆圈。颜色改变后,所有的圆圈都会变成相同的颜色,圆圈会移动一段时间。当圆圈停止移动时,将出现响应提示,参与者将选择三个彩色圆圈之一(“选择红色/绿色/蓝色圆圈”)。我很难将要选择的色环插入格式化字符串。我不断收到错误消息:%: 'TextStim' 和 'list' 不支持的操作数类型
我不确定我是否需要或如何转换这些列表,所以任何帮助将不胜感激!
n_targets = 7 #seven locations
circles = [] #setting up the circle stimuli
for i in range(n_targets):
tmp = visual.Circle(win,radius = 27,units = 'pix',edges = 32,fillColor='white',lineColor = 'black',lineWidth = 1, pos=(posx[i],posy[i]))
circles.append(tmp)
cols = ['blue','red','green'] #3 colors the circles will change to
targets = random.sample(circles,3) #randomly select 3 of the 7 circles
TrialTarget = random.sample(targets, 1) #select 1 of the 3 circles to be the target for the trial
#code for movement would go here (skipping since it is not relevant)
#at end of trial, response prompt appears and ask user to select target and is where error occurs
ResponsePrompt = visual.TextStim(win, text = "Select the %s circle") %TrialTarget