How to provide RT, corrAns and trial accuracy score feedback with a mouse

Hi,

I’m trying to figure out how to provide feedback for an experiment I’ve designed using a mouse.

The task is that participants are presented with pictures they need to categorise (category 1 is left clicking the mouse, category 2 is right clicking). I’d like to set it up so that when the participants make their ‘clicking decision’, they are presented with a feedback message that provides information as to whether they were correct/incorrect AND whether they were fast enough/too slow.

I imagine it would require creating a code component that reads something along the lines of:

    if mouse_2.rt < 0.7 :
    dur=1.0
    if mouse_2.corr: 
        msg="Correct! Valid Trial"
        dur=1.0
    else: 
        msg="Inorrect! Valid Trial"
        dur=1.0
else:
    if mouse_2.corr: 
        msg="Correct, but too slow!"
        dur=1.0
    else: 
        msg="Inorrect AND too slow!"
        dur=1.0

I also want it so that participants must get 60% of the 10 trials correct before they can progress. In the event that they succeed in doing so, I want the programme to take them to a ‘Congratulations’ routine with an image telling them they have succeeded. Alternatively, if they fail to reach a 60% accuracy score of the 10 trials, at the end of the 10 trials, I want an image/or text component to appear telling them that they must undertake the practice trials again until they have attained 60% accuracy.

I’ve been designing this in Builder View but have been unable to get the loop I create to provide me with feedback. As I have little to no experience with coding, if anyone can help me out ASAP and solve this issue for me, I will be forever grateful! :slight_smile:

I’ve attached the full experiment below. Feel free to isolate the practice trials loop where I need the feedback loop to exist.

Thanks!

P. S. @Yiannis and @jon, you both have been my godsend so far - is there any chance you could save me one last time pretty please?

PSYCM0056_Experiment (P&M_Trials) EXOTIC 1 of 3.psyexp (56.7 KB)

Hi Josh,

Can you try the attached .psyexp?

I have changed it slightly to make it run a bit faster for me including the trials_7 loop.

I have added some bits in the code component and a feeback routine. The thanks routine will only run if someone responded correctly more that 6 out of ten trials (but you can change this by changing the “mycounter” value. Thus, the Thanks routine can be changed to anything (i.e. the main trials for you)

I hope this makes sense.
PSYCM0056V2.psyexp (36.1 KB)