| Reference | Downloads | Github

Give unique Code to PARTICIPANT

Description of the problem: How do I need to change my settings so the .csv file that gets Saved has a unique code for every Participant and doesn’t look like this.


If you add the unique code to the participants field, the file will begin with your unique code, and you can parse this during your analysis. The timing data within the filename ensures with high probability that you never get a name conflict when saving data.


This is how I set it up. Am I missing a participants field somewhere?

Ah, yes unfortunately, the field must be “participant”, otherwise the input is not used in the filename.

@dvbridges how would I go about saving variables into the CSV file?

For local studies, you use Python code:

thisExp.addData('columnName', variable)

For online studies, you would the following JavaScript:

psychoJS.experiment.addData('columnName', variable);

@dvbridges thank you!

I was wondering if this can now be customized or the field must still be participant. The reason I am asking is that when recruited from Mechanical Turk, subjects may get confused regarding what to put in a field named participant; instead they would know what their WorkerID is.


@rob-linguistics13, ‘participant’ is not a required field online, but ‘participant’ is used in the data filename. If no ‘participant’ field is available, the default “PARTICIPANT” string will be added to the data file name. You will still have unique filenames though, based on the time and date of the participant completing the task.

1 Like

I’m wondering if the file name ‘PARTICIPANT’ string could be replaced by the experiment info that participant inputed at the begining of experiment?
In my online experiment, participant need to input they subject number, but every file name is same as ‘PARTICIPANT + experiment name + date’.

If the participant writes their ID into the field called participant then it should absolutely do what you’re asking. That also works if the value for participant is defined by a URL query string (e.g. from Prolific) rather than from the user typing into the dialog. If you’ve removed or renamed the ‘participant’ field, or nothing is inserted there then the string ‘PARTICIPANT’ is inserted instead.