Textbox questions

Hi all,

I have small question related to the use of the textbox (textbox 2 psychopy it says): I am trying to code whether an answer was correct (1) or not (0). In order to do so, I compare the answer in the textbox to the actual stimulus (both string variables)

first I define: text = ‘Antwort:’ + wordu1
(because it was not possible to use an empty textbox with only a cursor, in this case psychopy would say text.replace was nonetype)

Then in a next routine box (but within the same trial) I test the following:

if text == textbox_4.text:
score = score + 1
else:
score = score + 0

Screen Shot 2021-01-07 at 11.18.03 AM

Although my result data file shows that the text and textbox are the same the score does not add up… Does this have to do with features of the textbox maybe?

Thanks for thinking along in advance!

Best regards, Sanne