Howdy, Stranger!

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

Supported by

Recording multiple responses in a dual-task design

Hello Everyone,

I am currently setting up an experiment in which multiple responses need to be recorded during each trial. For brevity I will only describe the relevant sequence of the experiment. I want to present a first stimulus (image on sketchpad) for 2000 ms, followed by a 500 ms delay (also image on sketchpad), and a second stimulus (a third image on sketchpad) for 1500 ms. Throughout the full 4000 ms timeframe a response to the first stimulus can be given and should be recorded. There are two designated keys for this response [e.g., o and p]. In the last 1500 ms of the trial a response to the second stimulus should be recorded. Two different keys [e.g., q and w] are designated for this response. I have tried using the coroutines plugin to achieve this setup, but if the response for Stimulus 1 is given while stimulus 2 is already displayed and accordingly the keyboard_response item for this stimulus is active (i.e., response to stimulus 1 is given after 2500+ ms) it seems to be unpredictable whether any of the two responses, both responses or just one response is logged. I have since tried to use inlinescript to overcome this issue but that has not worked out.

Ideally, within the coroutine the program would constantly check whether one of the response keys designated to stimulus 1 is pressed. If that happens, it would log the response and the response time. Starting with the onset of the second stimulus, the program should additionally check whether one of the designated keys for stimulus 2 is pressed and if that happens log the response and response time.

Thank you in Advance,

Miro

Comments

  • Hi @Orimflow,

    Based on your description, I think you can achieve this using a co-routine like this.

    You'd need to use the response_time and response variables for the individual keyboard events to retrieve the data (the generic response_time and response variables will only contain data from the last respnse recorded).

    Also, it looks as if you need to disable the "Flush pending key events" for both keyboard events. This means you may record anticiptions (subject pressing q or w before the second stimulus is shown, but these are easily detectable in your data since the RT would be 0). The keys flushin of the co-routine is enabled, so that no response prior to the trial is registered in the current trial.

    It's important to define the allowed responses for your keyboard events. If you don't, the program will take the first response as the response to the first stimulus nd the second response as the response to the second. If you specific the allowed keys, the task can seperate the two events and responses are recorded correctly even if subjects respond to the second stimulus before they respond to the first.

    I had a go at simulating the task you described and it seems to work, though I'm not sure how reliable it would be if the two responses are very close in time). Have a look at my implementation and try it ou to see if it does what you need.

    Best,

    Fabrice.

    Buy Me A Coffee

  • Hi Fabrice,

    Thank you very much for your response! This resembles the approach I had first implemented very closely, although I did not disable the "Flush pending key events". However, upon trying out the experiment you attached, I still encounter the problem that if a response to stim1 is given late (i.e., after 2500ms+) it is not recorded. In the meantime I seem to have solved the issue using inline script. I think my solution is not the most elegant and some of the variables I create may even be redundant, but everythings is recorded. I have adjusted your exemplary experiment by inserting the inline scripts and removing the coroutine, feel free to have a look.

    Best,

    Miro

  • Hi @Orimflow@Orimflow,

    Only had a glance at your code but the logic is correct, yes. It might introduce some variability in the timing accuracy because of the code and loops involved, but the general idea for the method makes sense. Something like that could also be done using Javascript instead of Python.

    Not sure why my task didn't run properly when you tested. I did test it and, did it again just now and it does register the first response even if produced during the interval or the presentation of the second stimulus. Here's an example as displayed on he feedback object (you can see that the first response's RT is well over the duration of the first stimulus and the interval):

    Best,

    Fabrice.

    Buy Me A Coffee

  • Hi Fabrice,

    Thanks a lot for your updated response. It is really strange that the task didn't run properly on my computer (I even made sure to upgrade to the latest version of OS, since I was suspecting something might be off). Could it have something to do with the backend used? I used/use the legacy backend. Also thanks for pointing out the potential variability in timings that comes with my solution.

    Best,

    Miro

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