Set text based on list

Hi everyone! This is probably a super naive question. I have a loop around my practice trials with a list controlling the trials. I want to add a variable to this list that tells PsychoPy what the text displayed on certain trials should be, so on some specified trials in the list, it will display “RING” and on others it will display “DON’T RING.” I created a column in the CSV with the header txtGuide, and in each row, I’ve put RING or DON’T RING or a space so nothing appears. I added a text component to the trial that I want it to appear on, set the text to be $txtGuide and to set every repeat. After doing this, I don’t see the text displayed.

I’ve checked to make sure that the text should appear on the window based on the position I have it in (0, .20) with heights unit (made that mistake before). I’ve tried putting the text in quotes on the CSV and without quotes. There are no errors; the text just isn’t showing up.

Is there another way that I should be doing this?

What colour is your text?

Try an x instead of a space just to check.

This also sounds like you might find you could improve your experiment with my interleaved lists method

It’s set to be $[1,1,1].

I think I have some more info to share… I checked the JS file and the text component that I made for this isn’t being created in the JS script. There’s no sign of it in the JS script. I think maybe PsychoPy hasn’t generated a new script with this component, even though I’ve saved and manually pressed ‘Export to HTML’ several times. Do you know why it might be doing this?

Ah, it turns out it’s a compatibility issue. The solution can be found here: Unable to add working routines to existing experiment