Unexpected token '*', stuck in initialising experiment

From my understanding, you can’t use the import random code for online experiments. You have to change the code type to JS and write JS code. The Javascript crib sheet produced by @wakecarter should provide you with some assistance on how to deal with this issue (see attached URL). https://discourse.psychopy.org/t/psychopy-python-to-javascript-crib-sheet/14601