**OS Windows-10
**PsychoPy 2023.2.3
Hi! I am trying to create a backwards digit span that terminates completely after the participant makes three mistakes in the same trial. However, the code is stuck in a loop of the first trial, regardless of how the participant responds.
Code:
mistakes = 0
consecutive_incorrect = 0
if textbox.text == ''.join(reversed(str(digits))):
correct_digits = 1
fbTxt = 'Correct!'
consecutive_incorrect = 0
else:
correct_digits = 0
fbTxt = 'Incorrect'
mistakes += 1
consecutive_incorrect += 1
thisExp.addData('correct_digits', correct_digits)
thisExp.addData('total_mistakes', mistakes)
if consecutive_incorrect >= 3:
last_level = level
digitspan_trials.finished = True
digitspan_blocks.finished = True
fbTxt = "This experiment is now over."
Thanks for any help!