Creating clickable text alternatives

I see, so one thing to do (which I did) would be to randomise location and always have your correct response in the same column, but that would require a lot of changes in your experiment, so see if @dvbridges can help, especially because that’s a messy solution.
Looking at your files though (and I’m quite new to psychopy so might be wrong here), have you tried to change the code to:

if mouse.isPressedIn(eval(corAns)):
    thisExp.addData('responseAcc', '1')
else:
    thisExp.addData('responseAcc', '0')

as in, referring to your correct answer column directly?

@Bruno_Dalpiaz, the problem was that trial handler is called RMET_loop, whereas in my example it was called thisExp. So, change the code to the following in the End Routine tab, and it will (should) work:

RMET_loop.addData('responseAcc', corr)

See example data attached _untitled_2018_Mar_09_1603.xlsx (12.1 KB)

Now it’s working great! Thank you so much, @dvbridges. It had to be something that simple, now I feel a little silly because of that lol. I really appreciate the time you spend helping me, now I understand better the software and willing to learn more.

Thanks @agata for the tips too.

keep the awesome work.

Best Regards

1 Like

Hi @dvbridges
Is possible to add the RT of each text click and, if possible, the full RT of the routine? I’m not pretty sure how to code something like that.

Thank you very much.

Hi @Bruno_Dalpiaz, you can add the following to your code component under relevant tabs (assuming your mouse click ends the routine):

Begin Routine

stimOnset = []

Each Frame

if fixation.status == STOPPED and len(stimOnset) < 1:
    stimOnset.append(t)
if mouse.isPressedIn(eval(corrPos)):
    corr = 1
else:
    corr = 0

End Routine

fromFixationRT = t
fromStimRT = t - stimOnset.pop()
RMET_loop.addData('responseAcc', corr)
RMET_loop.addData('fromFixationRT', fromFixationRT)
RMET_loop.addData('fromStimRT', fromStimRT)
2 Likes

Works great, thank you very much, @dvbridges

Hey @dvbridges,
Experiment is working great, I just want to know if it’s possible to add a column next to responseAcc with the response that the participant gave (even if he clicked the wrong answer).

Thanks