Hello Matteo,
this version runs locally. I hope it runs in the way you intended it to do. However, the program does not run on-line. The error that PsychoJS throws is state.toLowerCase is not a function. You find some information concerning the error in the post just mentioned. I have been using PsychoPy 2020.2.10. I suggest opening a new thread for this.
dummyCodeTrans.psyexp (21.5 KB)
Best wishes Jens