Reading CSV File
Hi,
I programmed an opensesame experiment with a javascript backend, and I successfully uploaded it onto JATOS. I want the experiment to read all of the conditions from a CSV file that would be available globally for an online experiment. My question is: can I upload a CSV onto JATOS? Or how exactly should I link my experiment with a CSV that would be available globally?
I tried hosting the CSV file on Google Drive but that did not work due to CORS issues.
Thanks in advance!
Best wishes,
Elinor
Comments
Hi Elinor,
You should be able to simply add your .csv file to an arbitrary subfolder in your study. If you program and edit your study on a local JATOS installation first (which we recommend, for these cases exactly), you can just add the file in your file system. Then, when you export the study from your local JATOS and import it into the server JATOS, you'll get the csv packed inside.
Hope this helps
Elisa
Hi @elisa ,
Thanks for the advice! I think I got the general idea, and I installed JATOS locally. And then how exactly do I proceed? I tried moving the CSV file to the JATOS folder and to read the file in opensesame using the pool object and other parsing functions but none have worked so far. Any tips would be welcome.
Thanks again!
Best wishes,
Elinor
Hi Elinor,
You would need to:
Let me know if something isn't clear
Hi @elisa ,
Thanks for the help!
Everything worked out with the local as well as the global server. I realized that what I was missing was the pool of files, onto which I can upload the CSV in opensesame itself (View --> Show file pool). I simply uploaded the CSV to the pool and then called it using this script.
Thanks again.
Best wishes,
Elinor