conditionsFile as a parameter

I want to treat “Conditions file name” as a parameter in order to keep a counter balance (e.g., &fName) . So I define it in the code component that works in the “Begin Experiment” (e.g., fName=‘sList02.xlsx’).

This looks working well in my local computer, but not on Pavlovia with the following error message. I am sure that the xlsx file is properly uploaded.

The error massage is like below.

Could anyone help me to fix this problem?

Thank you in advance.

Yoshi

Hi Yoshi,

Could you share your gitlab project with me so can take a look? My pavlovia username is tpronk

Best, Thomas

Hi again,

First off, thanks for sharing an experiment that only had the parts that gave you a problem; that made it very easy for me to examine!

The issue is that PsychoJS only preloads the resources that it knows of in advance (i.e. before the experiment starts). Since the condition isn’t known in advance, it isn’t preloaded, thus causing this error.

I’ve got two possible solutions for you:

  1. Simple solution (I shared a version of your experiment which implements this one). Use a single conditions file, and construct sList01 to sList03 by indexing specific rows within the conditions file.
  2. Complicated solution. Use the psychoJS.downloadResources to get the conditions file. I’m not 100% sure if this would work, but if necessary, I could explore this option for you.

Hope this helps!

Hi Thomas,

Thank you very much for your help. The first one looks perfect for me. I am ashamed that I had been stuck in my first idea.

Best,

Yoshi

1 Like