Howdy, Stranger!

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

Supported by

Text input form for spoken word recognition

Hi all! I'm new to OpenSesame and am hoping to use the platform to administer a spoken word recognition task (where listeners will hear an audio file and type in the word they heard). I'm able to get something like that working with an audio sampler followed by a form text input, such that participants can see what they're typing and press the enter key to advance to the next trial. The form successfully logs the responses; however, in looking at the .csv file, I notice that it doesn't log accuracy or response time or the other types of things that the keyboard logger would. Is there a way to have it log the same information as the keyboard logger? Thanks!

Comments

  • Hi,

    The reason why these variables are missing is that they are not clearly defined (at least I presume so). For example, what is used as a response time? The time until the first letter is typed, or until the entire phrase is written? Similar ambiguities hold for accuracy.

    There are probably ways to retrieve these kind of variables, but what you have to do depends a lot on what you want. So, if you give more information on how you want response time and accuracy be defined, we can help you in a more suitable way. Here, just one example of code that might help you.

    # put this code in an `inline_script` (run phase) after the `form_text_input`
    
    # I'm not sure whether var.time_from_text_input is the correct variable. It should be. 
    # But if it is not, you can put the code: `start_time = clock.time()` in another `inline_script`
    # right before the `form_text_input` and then compute response times with this variable
    # This code defines response time as the time until the text input is confirmed with Enter
    response_time = var.time_form_text_input - clock.time()
    
    # this requires that you specified the correct_response beforehand, e.g. in the `loop_table`
    # this code is case-sensitive, so if someone responded `Apple` instead apple, the response is false
    correct = var.response == var.correct_response
    

    Hope this helped.

    Good luck,

    Eduard

    Buy Me A Coffee

  • Hi Eduard,
    Thanks! Yes, I was considering response time in this case to be the time until the first letter is typed. I have also specified correct responses in correct_response in the loop table and was considering accuracy to be an exact match.

    Angela

  • If it is the time until the first letter is typed, you won't be able to use the text_input_form, but have to use python scripting. It is certainly possible, but won't be very easy, especially if you want to have code that is flexible enough to deal with special cases, as corrections or uppercase letters.

    As a starting point, this code here does measure the time for the first stroke, and checks if the word matches the correct word:

    # open a keyboard
    kb = keyboard()
    # an arbitrary starting time to measure RTs
    # if you want it to be contingent on your audio playback, you need to know when I word was spoken
    t0 = clock.time()
    
    # define correct response
    correct_response = 'word'
    
    # makes sure that RT is only measured once
    RT_key = True
    # initialize response
    word = ''
    while True:
    
        # sample key strokes        
        k,t = kb.get_key(timeout = 10000)
        if k and RT_key:
            resp_time = t-t0
            # add letter to word
            word += k
        elif k:
            word+= k
        elif k == "ENTER":
            break
        # if participants is way to slow, abort the trial
        if clock.time()-t0 > 20000:
            break
    # was response correct?
    correct = word == correct_response
    

    I haven't tested the code, but something along these lines should be it. This code has to be placed in an inline_script and run while the audio is played back.

    Does this make sense?

    Eduard

    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