| Reference | Downloads | Github

Exxperiment won't present conditional instructions when running online (works fine offline)

Hi, I have a PsychoPy experiment which runs fine offline but has a couple of problems when running on Pavlovia.

One of the issues is that it won’t present the instructions at the start of each block. I don’t get an error message, but instead, nothing appears.

For my instructions I use a code component to modify the instructions according to condition (see attachment). This always works fine in PsychoPy though doesn’t seem to be working online.

Is there a way to fix it or am I doomed to build a really long clunky experiment with a different trial loop for each block? Thanks so much again for your help, it’s much appreciated!

I certainly change text dynamically. Your problem is that the text is being drawn before you’ve set showText. You could use ShowBlockText.text = “your custom text” or you could put your code into a new or existing routine that is activated before this one.

Also - I’d recommend that you use elif to replace your multiple if statements.

Thanks very much, but I don’t think that’s the problem (text being drawn before I set showText), because if it was, surely it wouldn’t work offline neither? But it works just fine when I run it offline.
However I’ve tried inserting a separate routine before my instructions routine with the code component. This doesn’t make a difference. I still get a blank screen.

I would like to try your other suggestion (You could use ShowBlockText.text = “your custom text”) but I don’t know exactly what you mean. Is that a line of code I have to insert somewhere?

Many thanks for your help!