is it possible to use a variable file path for condition files on pavlovia?
The following works just fine locally (Builder with a code component):
I have two routines:
trial. There is a loop
For the loop I set the file path for the conditions file to
In a code component (located in
start and under “Begin Experiment”) I initialise the variable
filepath_conditions based on input from
expInfo['treatment] (user input from the form before starting the experiment):
filepath_conditions = 'cond_control.xlsx' if expInfo['treatment'] == '1': filepath_conditions = 'cond_treatment.xlsx'
Both files are in the same directoy as the experiment itself.
This does pretty much what I want: When the user input for treatment is 0, then the conditions file for the control group is used. And when it’s 1, the the conditions file for the treatment group is used.
This does not work on pavlovia, though. It always gives me an error
Unfortunately we encountered the following error:
- when importing condition: cond_control.xlsx
- when getting the value of resource: cond_control.xlsx
- unknown resource
Is it just no possible at all or am I missing something?
If its not possible I can just use different routines - but I thought that it was a much more elegant way to do it this way.