Feedback only for negative responses in Psychopy

Hello,
I need help to get the feedback I want and I have no idea how to code this. My experiment is based on the FV-FN TAP flexibility task. I need to create a simple version of the task and a complicated version.

Stimuli = a pair of numbers where the first is always greater than the second.

Simple condition: alternate between adding and subtracting

81 64 (add)
18 9 (sub)
27 14 (add)
92 38 (sub)

So I use an excel file with the stimuli and the correct answer, which I put in a loop.
If addition: the answer must be greater than the number on the left; if it isn’t, it’s an error → tell the participant that on the next trial he must subtract
If subtraction → the answer must be less than the number on the left; if it isn’t, it’s an error → tell the person that on the next trial, they must add.
Feedback should only be given if there is a wrong answer; if there is a right answer, you move on to the next trial without any feedback.

Difficult condition:

There are blocks where you have to alternate and blocks where you have to do the same operation:

  • in the blocks where you have to alternate, the first pair of numbers is in blue and the + (or -) sign is present between the numbers, all the other pairs are in black
    -blocks where the same operation must be applied: the first pair of numbers is in red and the + (or -) sign is present between the numbers; all the other pairs are in black.

(In BLUE) 81 + 64
18 9 (sub)
27 14 (add)
92 38 (sub)

(In RED) 27 + 16
19 14 (add)
16 8 (add)

(In BLUE) 45 – 29
36 24 (add)
50 27 (sub)
75 12 (add)
89 15 (sub)

(In RED) 18 – 15
27 12 (sub)
67 24 (sub)

The feedback is the same for the difficult condition, the participant needs to know that after his error, where he stands. I was thinking of making an “error message” column in my excel file that indicates for each stimulus what it should do, but this message should be put before the numbers appear and only in the event of an error.

In my excel file, there are 6 columns
Stimuli1: the first number
Stimuli2: the second digit
Position1
Position2
CorrectRep
ErrorMessage

I don’t know if this is possible, thank you in advance for your help.

Here’s an example you could build on:

and this to pull from the excel sheet: How to randomize feedback or create conditional feedback

The only real difference for your case is that you need to look at the actual value participants provide and not just whether they pressed the right key. That depends on how you are doing your text entry.