FelixHenninger / lab.js

Online research made easy
https://lab.js.org/
Other
239 stars 107 forks source link

How to store a javascript object into lab.js's data #232

Open Max-Lovell opened 3 months ago

Max-Lovell commented 3 months ago

Sorry if this is the wrong locatino to post this but the slack isn't working and I can't find anywhere else to get help. I am running a lab.js experiment, and one of my tasks is written in pure html and js. I have got this to run inside lab.js but can't figure out how to get the resulting javascritp object of the participants data to save in lab.js with everything else.

What would you like or expect to see?

Store a JS object in the output data.

What is currently happening?

cannot figure out how to do this.

Please describe the steps needed to reproduce this phenomenon

N/A

Finally, please tell us which browser you're using (and the version thereof)

Chrome Version 122.0.6261.129 (Official Build) (64-bit)

Max-Lovell commented 3 months ago

I have found if I call const ds = this.options.datastore at the start of my script and then ds.set(data) at the end I can get each trial as a separate column in my dataset. Is there a better option than this?