psychopy.org | Reference | Downloads | Github

Feedback message relative to a single component

Participants listen to a 5 minutes sound-stream.
At the same time, images are presented on the screen in synchronisation with the audio file.
In order to synchronise the images to the sound I added the images one by one, and indicated the onset and the duration of each one in ms.
This inelegant option was forced by the impossibility to use a loop, because the amount of time needed to read the file from disk generated a delay within the loop and ended up in desynchronising images and sound.

Two images are presented: a square and a triangle (164 components in total).
I would like to collect responses and reaction times to the triangle only.
Equally important, I would like a feedback message to appear at the end of the block, indicating the number of times participants were able to press a button and detect the triangle.
As the two images cannot go in the same excel column, because only one of them would be read, I cannot use the corr_ans column either, so I don’t know how to tell the program which the correct answer is.
Furthermore, I cannot use this code

Corr = loop_1.data[‘key_resp_3.corr’].sum() #.std(), .mean() also available
meanRt = loop_1.data[‘key_resp_3.rt’].mean()
msg = “You got %i trials correct (rt=%.2f)” %(nCorr,meanRt)

in order to get the feedback, because I did not indicate the correct answer properly.

Is there a code that tells the program to collect data relative to one component, and give feedback only in relation with participants’ reaction to it? Is there any other way I could do it?

Hi Francesco,

Perhaps you can enter a code component at the end to check what the stimulus presented was. i.e.:

if thisStim=='triangle':
    TriangleCorr=1
elif thisStim=='Square':
    SquareCorr=1

In this option you would just change the terms ‘triangle’ or ‘Square’ to reflect the names of your stimuli in your conditions file.

Let me know if this makes sense,
Thanks,
Becca