psychopy.org | Reference | Downloads | Github

Condition file parameters are not accessed during loops

I have an experiment that works offline without problems.
I have several condition files for loops, and the correct one is determined in the routine before the start of the loop, where a string of the condition file name is built. Accordingly the condition file name is set to $varname in the gui for the loop.
In the online version, the correct condition file is indeed found, which I was able to check because at first an error appeared that the file (with one of the correct filenames) could not be found. After adding all condition files as resources, this problem was gone.

As my experiment was not working, I now tried to directly show the content of one of these parameters as text during a trial. Instead of the value, the text read “undefined”.

I tried this with xlsx condition files and csv condition files, but no values from these condition files can ever be accessed by my code or the components in the trials.

Hello,

do you mind sharing some more information, e.g. a toy-version of your experiment or some screen-shots of relevant builder routines? Do you get an error-message or is just the text-value displayed “undefined”?

Best wishes Jens

Hi Jens,

by now I changed to experiment to work without condition files. Here is a screenshot of the loop, the loop settings and the condition file.

.

As I said, the entire experiment worked flawless in the offline version, and everything in the pavlovia version worked except accessing these variables. I usually use the variable to change the presentation duration of certain stimuli, but when I saw that this did not work, I tried to access the variables directly by displaying them with a new text component. The text was empty when I just set the text to on of these variables. When I set the text component to "Gap Duration: " + gap_dur, the text read “Gap Duation . undefined”. When I set gap_dur to 33 at the beginning of the experiment, this value was never changed, and so the text just read “Gap Duration: 33”.
Maybe the fact that I’m assigning the condition file name with a string variable is a problem. Does the condition file maybe have to be initialized at the start of the experiment in pavlovia?

Hello alsei,

did you add the xlsx-file as an additional on-line resource? I attach a toy-example

stim_dur.psyexp (6.5 KB) stim_dur.xlsx (8.4 KB)

Best wishes Jens