Pavlovia: Session file variables not transferred to log file for last participants (first observed Sept, 2, 2019)

I was just getting my experiment ready for testing online and I have the same issue.

Variables supplied to PsychoJS for trials are not being recorded. Other variables remain unaffected (keyboard responses, reaction times, anything recorded in the expInfo object, and any manually recorded variables put in the JS code).

I used Psychopy Builder (along with custom code) 3.1.5 for the project.

As a temporary hack solution, you should be able to add custom JS at the end of the trial’s routine for each trial variable to ensure the variables are recorded in the output spreadsheet:
psychoJS.experiment.addData('variable_from_trial', variable_from_trial)

Also, to clarify, I encountered this just when piloting my study. After the pilot session, a .csv with the experiment results downloaded, but the trial variables were missing. I’ve updated my experiment’s javascript with the solution above, but won’t be able to properly test it until my pavlovia experiment updates itself with the new code from gitlab; from my experience this tends to take a couple of hours or so.

Update:
I just tested this and it works as a temporary fix. You need to add code to the end of routine in your trial loop. Some example code:
psychoJS.experiment.addData("stim_id", trials.trialList[trials.thisIndex]["stim_id"]);

where trials is the name of your TrialHandler object and stim_id is whatever you want to record from your condition file for your trials.

1 Like