Textbox Input Creates New Output

I am working on my thesis project, and I need to provide participants with a “completion code” at the end of the experiment to prove that they have completed the experiment. They are given a “participant number” in their email to participate in the experiment. I want them to input this 5-digit participant number at the end of the experiment and then have them receive their own personal 5-digit “completion code” to email back to the main researcher to receive credit for their participation. I have created an Excel document with one column of “participantNum” and one column of “completionCode”. I also have a textbox at the end of the experiment for participants to enter their participant number, and then I need the respective completion code to be outputted. How do I go about this?


I assume you need this for an online experiment. I have used a simpler solution. I generate a random string for each the participants had to send me via E-Mail. This random string is saved in the data-file giving me the option to check whether somebody took part in the experiment.

letters = ['A','B','C','D','E','F','G','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9','0']
vpkode = ''.join(letters[0:8])

Store the code in your data-file:

thisExp.addData('vpkode', vpkode);

At the end of the experiment, I presented a text-component with the following text:

$‘Please note your participant code ’ + vpkode + ’ and send an email containing this code to … \n\n Continue with j’

Unfortunately, the assignment of participant numbers via Excel does not work on-line, but see here for a solution to obtain unique participants numbers.

Best wishes Jens