Psychopy 没有得到所有的答案

Psychopy not getting all the answers

我正在使用心理学来构建认知任务。 我在屏幕上有 5 个圆圈,参与者需要按下好的圆圈。 我的代码:

if mouse.isPressedIn(cercle_1):
    continueRoutine = False
    # save data if you like:
    thisExp.addData('correct', 1)
    thisExp.addData('RT', t)

elif mouse.isPressedIn(cercle_2):
    # save data if you like:
    thisExp.addData('correct', 0)
    thisExp.addData('RT', t)
    continueRoutine = True
elif mouse.isPressedIn(cercle_3):
    # save data if you like:
    thisExp.addData('correct', 0)
    thisExp.addData('RT', t)
    continueRoutine = True
elif mouse.isPressedIn(cercle_4):
    # save data if you like:
    thisExp.addData('correct', 0)
    thisExp.addData('RT', t)
    continueRoutine = True

elif mouse.isPressedIn(cercle_5):
    # save data if you like:
    thisExp.addData('correct', 0)
    thisExp.addData('RT', t)
    continueRoutine = True

问题是我的数据文件只包含响应时间 (RT) 和 circle_1 的信息。我不知道参与者在按下 circle_1.

之前是否尝试过其他圈子

问题:如何在我的 csv 文件中包含参与者在按下 cercle_1 之前按下鼠标 bouton.Maybe,他按下 cercle_3 的所有时间的信息。现在,我只有多长时间才能得到正确答案。

听起来你想记录审判中的一系列事件。这可能很难找到合适的数据结构,但对于您的情况,我可以想到两种解决方案。

记录错误回复的次数

有一个列(例如 n_wrong)并计算 non-circle_1 响应的数量。在 开始例程 添加

n_wrong = 0

然后在每一帧添加:

if mouse.isPressedIn(cercle_1):
    thisExp.addData('correct', 1)
    thisExp.addData('RT', t)
    continueRoutine = False

elif mouse.isPressedIn(cercle_2) or mouse.isPressedIn(cercle_3) or mouse.isPressedIn(cercle_4) or mouse.isPressedIn(cercle_5):
    thisExp.addData('correct', 0)
    thisExp.addData('RT', t)
    n_wrong += 1  # One more error recorded!

    # Now wait until the mouse release to prevent recording 60 wrong clicks per second!
    while any(mouse.getPressed()):
        pass

然后在end routine下添加:

thisExp.addData('n_wrong', n_wrong)

记录按下了哪些圆圈

另一种方法是为每个圆圈设置一列,并在单击它们时将它们从 "unpressed" 移动到 "pressed"。然后 cercle1 列将对应于您当前称为 correct 列的内容。所以在开始例程:

# Mark all non-target cirlces as unpressed
thisExp.addData('cercle1', 0)
thisExp.addData('cercle2', 0)
thisExp.addData('cercle3', 0)
thisExp.addData('cercle4', 0)
thisExp.addData('cercle5', 0)

然后在每一帧下我会这样做:

if mouse.isPressedIn(cercle_1):
    thisExp.addData('cercle1', 1)
    continueRoutine = False
if mouse.isPressedIn(cercle_2):
    thisExp.addData('cercle2', 1)
if mouse.isPressedIn(cercle_3):
    thisExp.addData('cercle3', 1)
if mouse.isPressedIn(cercle_4):
    thisExp.addData('cercle4', 1)
if mouse.isPressedIn(cercle_5):
    thisExp.addData('cercle5', 1)

后一种方法可以通过添加名为 cercle1_rt 等的列来扩展反应时间,但随后您还需要使用 while any(mouse.getPressed()): pass 技巧来记录开始而不仅仅是释放.