Randomizaion and the condition file in Pavlovia

In your code component, you need to provide a JavaScript equivalent to your current Python code (as Python doesn’t run in a web browser). In your code component, select “Auto → JS” and Builder will do its best to automatically translate your Python to JavaScript. This probably won’t work perfectly. So if necessary, change the button to “Both” so that you can manually edit the JavaScript, to fix any problems with it emulating what the Python code does.

See here for some tips on PsychoJS equivalents to PsychoPy code: