How do I get Moving window presentation in self paced reading task?

Problem solved!

Following are the gif of my final result and the code I used. I only changed the part from ‘Begin Routine’ tap of the code component. The original code is from Michael from this link:
https://groups.google.com/forum/#!topic/psychopy-users/sjX7_Oa_WXc


def replaceWithdash(textList, currentWordNumber):     
    dashSentence = ''
    for index, word in enumerate(textList): # cycle through the words and their index numbers 
        if index != currentWordNumber: 
            dashSentence = dashSentence + '--' * len(word) + '--' # add two strings of dash characters 
        elif wordNumber==5: 
            dashSentence = ' ' + dashSentence + word + '.'# the last word will appear with a period
        else:
            dashSentence = ' ' + dashSentence + word + ' ' # except for the current word 
    return dashSentence # yields the manipulated sentence

Thank you for all the advice, Michael. Your answers led me to find a way to solve this problem even with those obstacles above.

Yours sincerely,
Kyung.

2 Likes