I am preparing an experiment in Builder, where I would like to run a trial 12 times per participant with the information from the Conditions file. According to that information the text and picture stimuli are chosen. So far, this idea works.
Due to several reasons (e.g., the complexity of the pseudo-randomisation and my better knowledge in writing R-code), I decided to prepare the pseudo-randomisation in R. As I don’t want to have one excel-file for every participant, I decided to have all trials (for all possible participant IDs) in one excel file. Within this file I have one column with the “participant_ID” (ranges from 1 to 100) and another column with the “trial_number” (ranges from 1 to 12). For each of the trials I have one text (“text_stim”) and one picture stimulus (“face_stim”) and I want to present both together. To present the face and the text stimuli together, I added the excel file as Conditions file to my trials-loop and everything runs smoothly. My only problem is that I just want to present those text/face stimuli which are assigned to the specific participant_ID.
Thus, I would like to specify the “Selected Rows” to just use those excel rows, where the “participant_ID”-column has the same value as the participant-ID entered at the beginning of the experiment in the pop-up window (specified by using: expInfo[‘participant’] ). As participant_ID I could either use numeric values (from 1 to 100) or strings where the numbers are padded with leading 0s (3 character strings).
I know one way to get there if I use a code component at the beginning of the experiment, but then I would need to specify with another code component which information I would like to add to the experiment handler (and, thus, to the final data sheet per trial). As I really like the convenience of “all information of the Conditions file is added to the final data sheet per participant” I would like to go via the “Selected Rows”-Option in the loop (which is around my trial routine) or via one code component within this loop. Furthermore, I would like to use the loopType: “sequential” (as I already (pseudo)randomised the order within my R-code for the excel file).
Summary or main question: How could I use only those rows from my Conditions file where the participant_ID column has the same value as the expInfo[‘participant’] ? Preferably, I would like to specify this in the “Selected Rows” option or in a code component within my trials-loop.
I am pretty sure that there is a more or less easy option to do so and I would appreciate suggestions how to get there. I hope I explained everything in an understandable way - if not, please let me know.
Thanks in advance,
Hannah