Howdy, Stranger!

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

Supported by

OSWeb play audios read from csv list depending on participant ID

Dear everyone,

I am trying to run my first OSWeb experiment. It works fine until I run it in the external browser.

In my experiment participants have to listen to audio recordings. There are two versions within this one experiment, which assign participants different audio files based on their participation ID.

I “coded” this with the help of lists in two csv files and this reference to the files: “version_[=var.subject_nr%2+1].csv” in the loop.

When the first audio is supposed to play I receive this message: “TypeError: r is undefined”

Does anybody have an idea how to fix that?

Thanks so much!

Comments

  • FabFab
    edited August 10

    Hi @julia_,

    If you print that same expression to the console, you'll be able to see what file name that expression is actually generating (my guess is that it generates a filename that does not correspond to your actual csv files). That'll make it easier to debug the issue. I don't think you can use operators within the [] because this defines the name of a variable.

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

  • @julia_

    Here's a example of how you can do it...

    The method consists in setting up a variable containing the filename in Javascript before the loop is executed (1). It is best to insert that code under the "prepare" tab (when running the task in OS, running it under the "run" tab works, but if you're running it in a browser, it won't. Make sure your csv files are loaded in the files pool.

    You can define stimfile using this javascript code:

    vars.stimfile=vars.subject_nr%2+1+".csv"
    console.log ("stim file : "+vars.stimfile)
    

    Outputting the variable's content to the console is good practice, it helps you check whether the content is correct (useful for debuging).

    Last bit needed: call that variable from the loop object:

    That's it!

    Yo can download this example here:


    Hope it helps!

    Fabrice.

    Buy Me A Coffee

  • Hi @Fab

    Thank you so much for your quick reply! And also for the step by step tutorial! Unfortunately I don't know anything about coding and also just received the variable string from someone else.

    I did what you said, but now I don't know where to find the generated file name?

    There's nothing else written in the console except for In [1] :

  • Hi @julia_,

    It should show in the console when the code gets executed:

    If you run the task in the browser, you can view the console too but have to bring it up (Ctrl+Shift+i in Edge, might be the same in Chrome; otherwise also accessible somewhere in your browser's menus).

    What you write to the console has no consequence for the task itself, it is just useful for you to be able to track what is going on while the task runs.

    With the example I sent you, you should hopefully be able to amend your task accordingly, though depending on how the task is setup you may need to adapt it a little.

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

  • Hi @Fab

    Thank you again! I did what you said, even had someone with more knowledge than me have a look at it but we could not figure out how to fix it.

    I saw that some people post their experiments in the forum so that y'all can have a look at it, which seems to be my hail mary right now.

    You can find it here:

    https://drive.google.com/drive/folders/1Nz0PpteI4sHyVmWdlc_2nPh71yC4WDxS?usp=sharing

    I changed everything back to how it was when I ran into my problem in the first place, we're talking about the "listening_task_loop" here, where it will stop playing in the browser.

  • Hi Julia,

    The suggestions of @Fab were solely meant to find out whether your experiment generates the path to the files correctly, and not to fix anything. The first part in helping you with your problem is to find out whether OSweb messes up the file names, or the actual presentation of the videos.

    Have you found out whether the correct file names are presented in the console?

    Perhaps it would also help if you shared your experiment here with us. Ideally, in a simplified way that removes as much of the complexity as possible, while still retaining the error and including the video files that are called.

    Thanks,

    Eduard

    Buy Me A Coffee

  • Hi @eduard


    Thank you so much for your message. Yes, the correct file names were presented in the console.

    And my experiment is actually running now, I'm sorry, I forgot to mention it here! I downloaded the newest OS version and then it worked most of the time. Sometimes there was still an error message but that has now disappeared, I don't really know what fixed it though, I tried a few things.

    Anyways, it's now all working out fine, also in Jatos.

    Thank you all for your help and willingness to help :))

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