Text stimuli not being read in from excel condition file

I’ve been trying to tackle this problem for a while and I don’t know what else to do.

In my experiment, participants make several choices. On each trial, they see an image for one second. After one second, the image disappears and two text options appear (one on each side of the screen). I have all of the images (and associated text options for each image) saved in a single excel file: the first column is the file path to the image, the second column is the text for the left side of the screen, and the third column is the text for the right side of the screen.

The image presentation works perfectly, so the excel file is definitely accessible. However, the text stimuli do not work; rather than presenting my actual stimuli (e.g. “Buy food for $2.00”), they say “Hello World”. Using console.log(), I’ve been able to narrow the issue to the fact that the text columns in my excel file are not being read in correctly. They are listed as “undefined” in the console. I’ve tried using .setText and .text to define the string for each trial; both yield the same “Hello World.”

Has anyone had a similar issue? Is there something weird about the formatting in excel conditions files?

Hey @smithsm11,

Could you share your gitlab repo with me? My username is tpronk. If you make me developer or maintainer, I can clone your experiment and see what’s up.

Cheers Thomas

Hi Thomas,

Thank you so much in advance for taking a look. I just made you a maintainer of my gitlab repository. (As you’ll see, my experiment is based off of your demo_eye_tracking2 project, so some of the code should be very familiar!)

I think I (finally) figured it out. I was using the following code to read in my conditions:
TrialHandler.importConditions(psychoJS.serverManager, filename, triallist)

Turns out that the triallist argument can be pretty finicky. The following inputs work:
'1:3'
['0','2']
But the following inputs DO NOT work:
1:3
'0,2'
['0,2']

I was trying to define the trial list elsewhere in my code, and I had it formatted incorrectly. Making it into an array works, though:
var trialsubset = [];
trialsubset.push(0);
trialsubset.push(2);

And then you can call:
TrialHandler.importConditions(psychoJS.serverManager, 'trials.xslx', trialsubset)

1 Like