The error in code about an accuracy criteria of 80% for the check loop

OS :Win10
PsychoPy version :2023.2.3
I am a beginner for PsychoPy and have been attempting to set up an accuracy criteria of 80% for a stroop test. That means the check loop ends only when the accuracy of response exceeds 80%. My classmate succeeded by the following code:
But when I typed the same code and ran it, I was given the following error message:

I don’t know how to change my code. Any help would be appreciated, and I am happy to provide more documentation of the issue if necessary.

The error is related to corr_total. Where does it come from?

Thank you very much!I found my fault. I missed some operations on two variables——corr_total and total. corr_total represents total correct response represents total response numbers.So I added codes in the feedback part which is earlier than check part.I wrote the following code at Begin Experiment:


And I added the following code at Begin Routine:


And I successfully achieved my goal!