我已經在Psychopy中創建了一個任務,其中從一個jar中繪製了一個珠子。要繪製50個不同的珠子,每個珠子之後要求參與者進行概率評定。該任務是從excel文件中循環的,但要做50個評分需要很長的時間。我希望能夠獲得前10個珠子的評分。然後爲第二個珠子繪製一個評級,直到繪製20個珠子。然後,對於接下來的30個珠子,直到第50個珠子只需要每5個珠子繪製一個評級(我對編碼真的很陌生,對不起,這可能會提前不正確)。 我已經寫了這樣的代碼,但不幸的是它不工作? (在沒有分級圈我試圖把鍵盤響應觸發下一個事情的順序出現) -我想在循環中的不同點觸發一個響應
for row_index, row in (beads_params_pinkbluegreyratingparamters.xlsx):
if row(0:10) and t >= 0.0 and rating.status == NOT_STARTED:
break
rating.tStart = t # underestimates by a little under one frame
rating.frameNStart = frameN # exact frame index
rating.setAutoDraw(True)
continueRoutine &= rating.noResponse # a response ends the trial
elif row(12:20:2) and t >= 0.0 and rating.status == NOT_STARTED:
break
rating.tStart = t # underestimates by a little under one frame
rating.frameNStart = frameN # exact frame index
rating.setAutoDraw(True)
continueRoutine &= rating.noResponse
elif rows.event.getkeys, row(11:19:2):
elif len(theseKeys) > 0:
break
key_resp_2.keys = theseKeys [-1]
key_resp_2.rt = key_resp_2.clock.getTime()
continueRoutine = False
elif row(20:50:5) and t >= 0.0 and rating.status == NOT_STARTED:
break
rating.tStart = t # underestimates by a little under one frame
rating.frameNStart = frameN # exact frame index
rating.setAutoDraw(True)
continueRoutine &= rating.noResponse
rows.event.getKeys, row[21, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 34, 36, 37, 38 ,39, 41, 42, 43, 44, 46, 47, 48, 49]:
elif len(theseKeys) > 0:
key_resp_2.Keys = theseKeys [-1]
key_resp_2.rt = key_resp_2.clock.getTtime()
continueRoutine = False
請修復您的代碼,這裏有很多錯別字! – MisterMiyagi