Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

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:

    • Install JATOS locally (as you've done already)
    • Import your study, written on OSWeb. Basically what you described before. Instead of uploading into the (server) JATOS, just import it on your local JATOS.
    • On the main JATOS page, if you scroll down, you'll see a note that says: "Where are my files". That's the location, in your local filesystem, where your study files are.
    • Just open that folder, and then you can place your CSV in there, within the folder of your .
    • (I can't tell you how to change your script so that the csv file is read - that's a question for opensesame, but from what I understood, you already know how to do that)
    • Then go to Study -> export. This will give you a new jzip file with the csv inside, that you can them import into the sever

    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

Sign In or Register to comment.