Self-paced Reading - Collecting IRI values

OK, the important thing is that in Python, white space (i.e. indentation) has semantic meaning. In your code above, the thisExp.addData() line is indented so that it appears within the if wordNumber == 0: check. That also means that the timeOfLastResponse = thisResponseTime line immediately counteracts the timeOfLastResponse = 0 above it.

So you need to “de-indent” those two lines by four spaces each leftwards, so that they are no longer encompassed within the if wordNumber == 0: clause. That way, those two lines will run for each key press, not just the first.

1 Like