Howdy, Stranger!

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

Supported by

Saving Data JATOS

I have a HTML5 intentional binding experiment that I am currenting trying to get on JATOS. I am bit new to this, and cant figure out how to send the data to the server. Would the JATOS code to push the data go in the main HTML file or the .js files? The webclock.js file is where the data is being collected, but trying to convert that data to CSV does not seem to be working. Any help would be greatly appreciated.

Thanks,

Jason

.

Comments

  • edited November 2020

    Hi Jason,

    A few things:

    • Are you sure that an intentional binding paradigm will work online? You're expecting effects in the order of tens of ms, if I'm not mistaken. That's not (usually) the kind of temporal resolution that you might get from the browser. Worth trying, but keep in mind that experiments cannot always be very easily translated from the lab to the browser.
    • The JATOS functions (all of those from the jatos.js library) would go into the JS, not HTML.
    • I only found labclock.js in your folder, and that is a declaration of a javascript object (that includes functions). Not strictly a javascript. Are you using any libraries to write your study? That is important information.
    • There are many reasons why your study isn't working and it's hard to pinpoint where exactly to start to help you without more information. It would help if you first create a JATOS study, add your components as they should look like, attach the HTML files corresponding to each component, export the .jzip file and send me that. Also, did you add the necessary lines ad the beginning of your JS?
    • After that, you could try to debug your code: In your browser, go to View -> Developer Tools, and see if there are any errors showing up in the console. That will point you/us to the lines that are causing trouble.

    The following two pages from the docs might help

    Best

    Elisa

  • Hi Elisa,

    Thanks for getting back so quickly!

    I have it set up on JATOS and it runs--I just cant get it to send the data after it is done (I have attached the JATOS experiment (I had to zip the jzip file). The version I am using has been used online before (https://www.nature.com/articles/srep32689).


  • I should add I added the additional lines in my HTML header as suggested by the site


    <script src="/assets/javascripts/jatos.js"></script>
    


  • Try with this line instead:

    <script src="jatos.js"></script>
    

    And I tried your study and got an error that 'results' is not defined at this location:

    // Show data (JSON format)
    var dataAsJsonStr = JSON.stringify(results);
    

    And then I looked a bit around in your experiment. I cannot say I understand the whole code, but in labclock.js is a function storeExperimentData . It seems to do sending of result data. Maybe this is the point were you can change the code to send your result data to JATOS instead?

    Best,

    Kristain

  • Thanks! I will give this a try!

Sign In or Register to comment.