| Reference | Downloads | Github

Duration variable does not work on Pavlovia, but works with PsychoPy

URL of experiment:

Description of the problem:


I tried to use a Code Component to generate a duration value between 1 and 3 seconds, then using $ sign to assign this variable to a duration box to set the duration of a text component.

The variable works as expected (generating random number between 1 and 3) in both PsychoPy (v2020.2.3) and PsychJS (on Pavlovia). However, this variable only controls the duration in PsychoPy, but not on Pavlovia.

My question is how to control the duration of a component (text, image etc.) with variables in PsychoJS (Pavlovia).

Really appreciated.

Hi Gabriel,
I’m not an expert, but I can try to help. Could you give us the snippet of python and javascript code you are using to do this? Also can you tells us what error it gives you on pavlovia?

Hi Gabriel,
I’ve done something similar in my own experiment, and I think I may be able to help you. If you haven’t already figured it out, please share a code snippet and whatever error message you receive from the Javscript!