| Reference | Downloads | Github

Feedback from previous trial erronuously flashing at the beginning of a trial

URL of experiment:

Description of the problem: A portion of my experiment involves a practice trial in which participants view stimuli and make a response using left/right arrows. They then see immediate feedback on the screen, which consists of either “correct” or “incorrect”. The issue is that, currently, feedback from prior trials flashes quickly on the screen before participants make a response. For instance, if they received feedback “Correct” on a given trial, this feedback flashes very briefly at the beginning of the next trial and then disappears.

Text that I display consists of “$Conditional” variable. This variable is defined as follows within the code component:
Begin routine:
Conditional = "";
Each frame:

Conditional = "";
if ((Square_Prac_Resp_1.keys === "left")) {
    Conditional = "Correct!";
} else {
    if ((Square_Prac_Resp_1.keys === "right")) {
        Conditional = "Incorrect";

End Routine:
Conditional = "";

I did some searching through the archives of Psychopy and found the following suggestion to a similar issue posted by @Michael:
“don’t be afraid to split your trial into multiple routines. i.e. in the first routine, present the stimuli and collect the keyboard response (set to force the end of the routine). Then in the next routine, present the image stimulus again, along with the feedback stimulus. They will all be set to appear at time zero, so from the subject’s point of view, there has been no visible disruption to the image stimulus. Both routines occur within the same iteration of the loop, so there should be no longer be any issue with showing the feedback based on the value from the previous iteration.”

However, I was wondering if it might be possible to ‘clear’ the text feedback before the following routine, rather than creating multiple routines. I thought that I was doing just that by resetting the text variable to blank (Conditional = "";), but it still shows up briefly at the following trial.

I am attaching a few screenshots as well in case they help get oriented with this setup.

@dvbridges, the site will not let me edit this post, so I am posting a clarified version of this question. I was wondering if you might have suggestions for this. I tried several troubleshooting approaches (including the suggestion to leaving the stimulus up in one trial and present it again on the following trial, along with text), but none of them fix the issue.

It all works in Psychopy but the issues comes up in Pavlovia and I was wondering if anyone might have suggestions for this. Please see below for the clarified question:

Updated experiment Url:

I am attempting to present text feedback to participants (Correct or Incorrect) after they make a response to the stimulus (left or right). I successfully did this, however, at the beginning of every stimulus, the following words flash: “default text”.

Does anyone know how to get rid of this?

I wrote the following in the Code component (Begin Experiment as well as begin routine):

Conditional= ''

I also pasted $Conditional into the text component, set to repeat every frame (although I played around with changing this, and it does not fix the issue).

I put the following code into the Each Frame component:

if Square_Prac_Resp_1.keys=='left':
    Conditional = "Correct!"
elif Square_Prac_Resp_1.keys=='right':
    Conditional = "Incorrect"

The feedback displays properly, but the words "default text" flash at the beginning of every trial.

This seems like an issue that has been reported before, so really does need to be addressed:

1 Like

Thank you for pointing me to this! The suggestion to add setText(’’) at the beginning of every frame solved this problem.