Reading CSV file in OSweb
Hello,
I have an experiment where the trial info for each subject is pre-defined using a separate .csv file (e.g., sub-01.csv, sub-02.csv, etc.). To run the experiment for a particular subject ID, I would need to import the corresponding csv file. This can be easily done using Python inline scripts if running the experiment locally. But I wonder if there is a way to do this using javascript in Osweb?
Thank you,
Han
Comments
Hi Han,
I'm afraid that this is not possible in OSWeb. I ran into this issue myself too, and I solved it by creating multiple
loopitems, each with a different table, and then using a run-if statement to run a specific one based on the subject number and a modulo (%), e.g. like so (if you have four differentloopitems):Not very elegant, but it should work for most cases!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
Thanks for the work-around! Any plan for integrating this function into OSWeb at some point? Being able to import condition files would allow for much flexibility in designing experiments...
Thanks,
Han
Hi Han,
Yes, this is definitely something we plan to do. I don't have a timeline though. For now, we mostly want to focus on stability and bugfixes in OSWeb, and then take it from there.
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!