I’m going to recruit participants from mturk/prolific, then use qualtrics to generate a participant ID, pass this to psychopy/pavlovia then at the end of the experiment, display their participant ID for them to enter as a completion code. I can pass the code from qualtrics to psychopy/pavlovia by I can’t seem to display the participant ID.
What did you try to make it work?:
I’ve added a routine with a text block:
msg = "You have now finished. MTURK CODE:" + expInfo['participant'];
What specifically went wrong when you tried that?:
In PsychoPy I get the message "NameError: name ‘msg’ is not defined, and in Pavlovia, I get a screen that displays “Hello World”, not the message I’m trying to display.
The variable msg needs to be defined before the text component tries to use it.
So your code should be put in either the “Begin experiment” tab of your code component, or if it is in the “Begin routine” tab, the code component needs to be above the text component (you can re-order components by right-clicking on their icons).
I had a very similar problem just now and figured it out. I think Micheal is right. You do not define “msg” this variable properly, so Pavlovia is not able to read it and present “Hello World”. Perhaps it seems that you defined, but somehow the order of your codes or putting it into wrong tabs makes Pavlovia think you don’t define “msg”.