I’m having some issues importing images from the experiment CSV file. The experiment runs by pointing to each row in the .csv and pulling files out of each column in that row so that the proper stimulus for each trial is displayed to participants. I’m using branching logic to check whether a trial requires a file print from a particular column (.test.is()). Some trials have yes/no questions and some trials have multiple choice. Participants are making their selections by clicking images in the Selector element.
In the .success(…) and .failure(…) portions of the code the program malfunctions. If I hardcode the files into the program it runs fine. When I use variable.ColumnName to grab the file name I need, the entire program refuses to load after the welcome page (it says resources preloading but when I check the Log all the resources have preloaded). If I skip with the debugger to the trials where I’m using the variable.ColumnName command it loads those trials fine (and selects the right files). I’ve tried filling the .csv so there are no empty boxes but that didn’t solve the issue. I’ve triple-checked the spelling in the .csv vs my file names as well.
The problem was coming from the assumption that newImage commands embedded in the success would only be evaluated in case of a successful test, but all new* commands are evaluated at the beginning of the experiment, even if they are embedded in a test command that will be evaluated upon runtime. One reason for this behavior is to let PennController preload the resources as soon as possible.