In my experiments, participants will enter their personal participant code in the beginning of the experiment and based on this code, I want to select their trial list and present it in the following loops as the condition file.
However, as I want to load the experiment to Pavlovia, I do not know how to read in my csv file (without using panda) that contains a row with the participant code and the respective file name in the same row. I also would like to know how I can select the file name based on the entered participant code from that list.
I would be very thankful if anyone could help.
Thank you so much!
I can think of four ways to translate a participant code into a filename.
-
Have filenames containing the participant code and use, e.g. conditionsFile = 'conditions_' + expInfo['participant'] + '.xlsx'
-
Add a dictionary to the shelf.
-
Use if / elif statements in a Begin Experiment code component.
-
Cycle through a spreadsheet in a loop checking if expInfo['participant'] == Participant:
In all cases you will then need to dynamically load the appropriate spreadsheet using a JS code component. I put the following code in Begin Routine of the first routine.
psychoJS._serverManager.prepareResources([
{ name: (conditionsFile), path: (conditionsFile) }
]);