How do I do a word-by-word presentation of sentence stimulus?

Hi all,

I’m running an acceptability test and managed to build a self-paced reading test, with the space bar triggering the next word. However, I’m having issues converting this into an independently timed test.

begin routine:

words = sentence.split()
numWords = len(words)
totalDuration = numWords * 0.3
currentWordIndex = -1

Each frame:

checkIndex = int(t/0.3)
if checkIndex < numWords:
   if checkIndex != currentWordIndex:
      currentWordIndex = checkIndex
      text.setText(words[currentWordIndex]) # update to the current word

What sort of issues?

I have a dictation task where I alter the presentation time of each word based on its length.

Hi There,

Your code worked perfectly for me!

Here’s how I plugged it into builder so you can cross check.
untitled.psyexp (8.1 KB)

Becca