Show A Part of Sentence Word by Word + Set triggers

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win11
PsychoPy version (e.g. 1.84.x): v2023.2.3
Standard Standalone? (y/n) If not then what?: Y
What are you trying to achieve?:

Hi all,

I am trying to show a part of a sentence word by word, which includes 4 parts: 2nd part + article + target_word + end_word. Meanwhile, I want to send triggers at the beginning of each of the four parts.

What did you try to make it work?:
I tried the design below:


and included code in ‘context’:

and in each text component:


The settings of my loops are:

What specifically went wrong when you tried that?:
In this way, I can successfully show the ‘2nd part’ word by word but fail to show the ‘end_word’ part. When the presentation came to the ‘end_word’, it showed nothing and wouldn’t proceed with the experiment no matter what keys. When pressing ‘ESC’, it exited the experiment and sometimes it crashed.

When I tried to add the ‘Parallel Out’ component to the ‘2nd part’ and ran the experiment, it stopped showing things at the beginning of the ‘2nd part’. So I was wondering if the issue I describe above is because I incorrectly added the ‘Parallel Out’ component. Or there are other reasons for it.

Thank you very much for your help! :slight_smile:

What is the result of the print statements?

If the issue is in the end_word routine, please could you show details about it?

Hi,

Thank you so much for your reply!

The result of the print statements is:

and then it stopped presenting words. When I press ‘ESC’, the runner started to show:

In the end_word routine, I added a text and a code component, which are:

In the code component, I wrote:

In the text component, I set:

This is the sequence of routine around the end_word part:

These are the details in the loop:

Thank you very much!