Howdy, Stranger!

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

Supported by

Integrating OSWeb as a JATOS Component

Hi erveryone,

I am trying to integrate a OSWeb study as one component of a labjs JATOS study but haven't had much luck so far. The goal is to host a normal questionnaire as one component that participants work on first and then add an additional component that should be the OSWeb task. How can I set this up? The import of the two separate studies works - I tried combining the files from the .zip folders in a new .zip folder with different subdirectories plus adjusting the jason file but JATOS keeps informing me that the study is invalid. Do you have any tips/advice for debugging or solving that problem?

Thank you!

Comments

  • Hi Sophie,

    That’s a common misconception: you should not create a zip file by zipping it by hand - you should instead do it by Exporting a study from JATOS.*

    To combine two zipped studies into two components, you could do the following:

    1- Import the labjs_study.zip into JATOS. You should get one study with a single component. Identify the folder in your local computer where these study assets are.

    2-Import the OSWeb_study.zip into JATOS. On the component bar, click on More> Export Properties. Save this file on your (e.g.) Desktop.

    3-In the first study, go to Components>Import Properties. This will create a new component in your first study, with the correct properties, including the HTML/JS file that actually runs your study.

    4-Unzip your OSWeb_study.zip on your (e.g.) Desktop. Identify the HTML file that corresponds to your component, created in OSWeb. Move this file to the study assets of the labjs one. If you have css files and other assets, move that too-.

    5-Now you have one study with two components. Note that you will likely need to modify the JavaScript code itself in the first component. It will probably have a line that reads jatos.endStudy. You'll have to replace it with jatos.startNextComponent (see here for more details http://www.jatos.org/jatos.js-Reference.html#jatosstartnextcomponentresultdata-onerror)

    6-Export your study (with two components) as a single .zip file by clicking on Export on the study bar

    This sounds complicated but is actually rather simple. If you have problems, let us know

    Elisa

    *In the latest JATOS release we changed the extension .zip to .jzip, with the hope that lesss people will be tempted to create a .zip file by hand.

  • Thank you, Elisa, for this detailed explanation - it worked perfectly!

  • Hi!

    I have the same issue but can't seem to make it work. I create a simple questionnaire using lab.js and exported it. I was then able to import it in JATOS and it runs ok.

    I also have another study exported from OSWeb that works in JATOS. However, I cannot combine the two as per your guidelines above. Specifically:

    3-In the first study, go to Components>Import Properties. This will create a new component in your first study, with the correct properties, including the HTML/JS file that actually runs your study.

    When I do it, I need to choose a file to import. I can then import my OSWeb/opensesame experiment

    4-Unzip your OSWeb_study.zip on your (e.g.) Desktop. Identify the HTML file that corresponds to your component, created in OSWeb. Move this file to the study assets of the labjs one. If you have css files and other assets, move that too-.

    I can unzip it but I am not sure what you mean with "move this to the study asset". Also, I don't seem to have the HTML file..

    Am I missing something?

    Thank you!

  • Hm, let's see.

    Point 3 is dependent on Point 2. Were you able to export the properties of the OSWeb component, and save the properties file as .jac file on your Desktop? You have to click More>Export on the component bar. The .jac file is what you need to import on Step 3.

    Here'a a screenshot of how that would look on a different study with more components, but it should be illustrative nevertheless



    And Point 4 is dependent on Point 1:

    Your study assets is on your JATOS installation folder. For example, if I run JATOS locally (and I recommend you do too, to combine components from two studies), my study folders are all in /Applications/jatos/study_assets_root. Within the study_assets_root folder you should see the folder that corresponds to your study. (That was point 1).

    What are the contents of your unzipped OSWeb study? You should have an HTML file...

    Best

    Elisa

  • Hi !:)

    I have a questionnaire and an osweb component in an online study in Jatos. I did everything as suggested above and it works. Thank you for the good instructions!!! However, one of my loops in the osweb experiment has an error for some participants. Is it possible to keep the same link of the study, but change the osweb component with a new one?

    Thank you!:)

  • The short answer is yes. Even if you update the study scripts, the link to it will remain the same.

  • Hi,

    I am trying to do a similar thing but with 2 differnt OSWEB expriements. The experiment uses images so the file is really big. I want to chop it into 4 different OSEWEB experiements and add them as components in Jatos.

    I followed the guidance above and got a contsent form and an OSEWB experiement set up and running but I can't replicate with multiple OSWEB studies. When I add the second component, it just runs the first component.

    Is there a way to change the file path of the second component? The image below show the properties of the second component and the folder of the study asset is for the first component. Can I change this?




  • Hi Skilli!

    You can't change the first part of you path, but you can change everything afterwards including adding subfolders. You could put each of your OSWeb experiments into its own subfolder, e.g. exp1, exp2, .... And each subfolder will have its own index.html. Then the first component's file path is exp1/index.html, second's exp2/index.html and so on.

    Best,

    Kristian

    Buy Me A Coffee

  • I'll give it a go. Thanks @kri

  • Hi @kri

    I got stuck at the first hurdle. I can't change the path. I have tried with and without / in front of part 1. I get a "Not valid path or filename" error.

    Here is the total path.

    C:\jatos_win_java\study_assets_root\e12584feb975ad3caca705242b36e575\part 1\index.html

    best


    Skilli

  • I just tried on experiments.jatos.org and there it works. I see yours is on windows. Can you try without the space, just 'part1'?

    Buy Me A Coffee

  • That worked, thank you! However, the OSWEB study does not load as a second component.

    I just get the following screen. Frozen. It workes fine as a first component but not as a second component. So Close!


  • Hi, I suspect that is because (maybe) OSWeb uses jatos.endStudy at the end of the code. Can you open and edit your javascript? In that case, look for the call to

    jatos.endStudy() and replace it with jatos.startNextComponent()

    If this works, let us know. We'll ask the OSWeb developers to include the startNextComponent function by default, which will finish the study if there is no next component.

    Best

  • @Skilli This happened to me as well (several times) and it might be that the browser you are using is not compatible with the experiment. Try a different one. This solved my problem. However, many people that wanted to participate in the experiment had an older version of their browsers and ran into the same propblem. Hope this helps

  • edited September 17

    Hi @elisa


    Thanks for the reply. I am very new to all this JAVA and HTML.

    The first component works great and the Jatos.js file associated with that component does have  jatos.startNextComponent() in it.

    I have set up a new study with the second component as the first and only component and it works.

    It doesn't work when the assests of the second comonent are included in a subfolder of the first component (as suggested by @kri above)

    Component 1.

    C:\jatos_win_java\study_assets_root\PrimingPractice

    Component 2.

    C:\jatos_win_java\study_assets_root\PrimingPractice\stage1


    Should I take my query to the OSWEB forum?


    Many thanks


    Skilli

  • Hi, I don't think Kristian's suggestion was having the assets as a subfolder. The .html and assets for both components should be at the same level. OSWeb produces a single HTML, always names the same way (index.html), so you'll have to rename those files in order to have them both in the same folder. I don't *think* this will lead to problems with the rest of the OSWeb folder, but I might be missing something.

    So it should look something like this:

    Component 1's HTML path:

    C:\jatos_win_java\study_assets_root\PrimingPractice\index_component1.html (Choose a more informative name that reflects what your component actually does!)

    Component 2's HTML path:

    C:\jatos_win_java\study_assets_root\PrimingPractice\index_component2.html

    To be clear, you'll have to change both the filename and the filepath in the JATOS components' properties.

  • @maj_zmaj thanks for the suggestion. I have tried in explorer/edge, chrome and firefox all most recent versions but no luck.

  • Eli's way might work but I was talking about a subfolder for each component and in each subfolder you will have one OSWeb experiment.

    In your file system (you can change the naming of 'exp1' and 'exp2':

    C:\jatos_win_java\study_assets_root\PrimingPractice\exp1\index.html
    C:\jatos_win_java\study_assets_root\PrimingPractice\exp2\index.html
    

    Then:

    1. Copy-paste all files from the first OSWeb experiment into 'exp1' subfolder
    2. Copy-paste all files from the second OSWeb experiment into 'exp2' subfolder
    3. In JATOS go to your study -> first component -> properties: change 'HTML file path' to `exp1/index.html`
    4. In JATOS go to your study -> second component -> properties: change 'HTML file path' to `exp2/index.html`

    If this doesn't work, you can send me both of your studies and I can have a look.

    Buy Me A Coffee

  • Thanks for the clarity @kri . I have tried the method you suggest and created a seperate folder, within the study root folder, for each component (practice and stage1)


    C:\jatos_win_java\study_assets_root\priming\practice

    C:\jatos_win_java\study_assets_root\priming\stage1


    However, this doesn't work and I just get a blank scree with a missing openseasme figure.

    I tired @elisa method and inlcuded both index files and OSWEB files for both components in the study root folder (see image) and it works.

    Many thanks both.

    Deiniol

  • Hi @kri


    Although Elisa's method works, I can see the advantage of having studies in subfolders so I would appreciate your offer of trying to get it to work. The files are too big to add as attachments so here is a onedrive link with the 2 components of the experiemnt. I have inlcuded the opensesame files and the OSWEB zip folders.


    many thanks.

    Deiniol

  • Hi Deiniol,

    I uploaded your combined study to your OneDrive: the file posLeft.jzip. Please check that everything is correct, e.g. I think I missed to copy your study's comments. Apart from that, I think, it works. The trick was to use the path with subfolder in the index.html. So instead of

    <script src="js/osweb.1.3.8.bundle.js" type="text/javascript">
    

    one had to use

    <script src="13111d9d7b8cbaa90b55dc4c0192d659/js/osweb.1.3.8.bundle.js" type="text/javascript">
    

    Best,

    Kristian

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games