私のタスクは、複数のオブジェクトを追跡するタスクのバリエーションです。画面上に 7 つの円があります。ランダムに 3 つの円を選択して色 (赤、緑、青) を簡単に変更し、参加者にこれらの円を追跡するように指示します。色が変わると、すべての円が同じ色に変わり、一定時間円が動きます。円の動きが止まると、参加者が 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