Randomizing Two Lists of Stimuli within a Single Loop - Online

After getting your experiment up and running locally (in python), you need to convert the python code to Javascript so that it runs online. PsychoPy has this amazing auto ‘translator’ turn python to JS for you. But it is not perfect, you probably will need to go through a debugging process. You can open your browser console to read what your program complains about.

For example, your num_item variable is not defined. JS has different scope for variables (compared to python), the variables defined within a function won’t be readable globally. That may be the reason why your local python program works but JS doesn’t.

You may find this link helpful PsychoPy Python to Javascript crib sheet