Providing immediate feedback for mouse click

Hi,

I am building an experiment in which participants have to make a judgement about whether or not a sentence makes sense. Participants see the sentence on one screen, click when they have read the sentence, and then have to click a box that says either True or False (with a prompting question above asking if the sentence makes sense).

For feedback, I want a message saying either Correct or Incorrect to appear at the bottom of the same screen where they make the True/False judgement. This should appear for 0.5 seconds, after which point the trial will end and the next one will begin.

Here is a screenshot of my routine structure for the judgement:

My mouse settings:

My feedback text:

And here is my custom code component that I have attempted to solve my problem with:

#Begin routine

msg = ''

#Each frame

if mouse_5.isPressedIn(True_Box) and PTrueFalse == 'T':
    msg = 'Correct'

elif mouse_5.isPressedIn(False_Box) and PTrueFalse == 'F':
    msg = 'Correct'

else:
    msg = 'Incorrect'

The sentences being presented are coming from a condition file that has a True/False column, hence the if and/statements above.

Right now when I run this experiment, no feedback shows up and the routine ends on click. I know that I have this set in my mouse component, which is how it should be indirectly, but I want the feedback to be presented before ending the routine. So basically, I want the mouse click to force end of routine 0.5 seconds later (during which time the feedback will be presented).

Any help or insight into my problem would be greatly appreciated!

The easiest way to deal with this is to make a copy of the routine which lasts for .5 seconds and redraws the elements of the trial.

Doing it in one routine is possible but needs you to save the time of the response and then end the routine using code instead of the component.

1 Like

That makes so things so much easier, thank you so much!