Howdy, Stranger!

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

Supported by

I need to collect two responses during same time window? how can I implement this in open sesame?

edited December 2016 in OpenSesame

I'm designing a modified no/go task which also collects responses from subjects when they make error.I need to collect response for each trial if its a go trial and a error response following it if they fail to act according to the go/no go conditions (i.e, when they withhold during go condition and press key during no go condition). I need to collect both the correct response ( during go trial) and error response (during both go and no go trial) in a time window of 1600 ms.

Comments

  • Dear rampriya,
    Please specify your question. As far as i know there is one response (go) or cero responses (no-go) in this task. Do you want to present feedback? Is it that what you mean with "a error response following it if they fail to act according to conditions"?

  • Hi Rampriya,

    Similar questions have been asked throughout the years, see for instance http://forum.cogsci.nl/index.php?p=/discussion/23/solved-go-nogo-task

    Cheers

    Josh

  • @DahmSF NO, not as a feed back. But as a separate measure to gauge their error monitoring performance, they are supposed to indicate that they have made an error ( i.e they have failed to press according to the no go conditions) by pressing an another key soon after they have realized the error. For clarification, i'm quoting the description of the experiment from murphy,2012 paper.

    We employed the EAT, (see Figure 1) developed by Hester and colleagues (Hester et al., 2005, 2012). The EAT is a Go/No-go response inhibition paradigm in which a serial sequence of color words is presented to participants, with congruency between the font color of the word and its semantic content manipulated across trials. In the iteration of the paradigm used here, subjects were required to respond as quickly as possible with a single “A” button press in situations where the semantic content of the word and the color in which it was presented were incongruent (Go trial), and to withhold this response in two different circumstances: (1) when the word presented on the current trial was the same as that presented on the previous trial (“Repeat” No-go), and (2) when the meaning of the word and its font color matched (“Congruent” No-go). In the event that participants failed to withhold to either type of No-go stimulus (a commission error; referred to hereafter as an “error press”), they were required to press a second “B” button as quickly as possible when they realized their error (referred to hereafter as an “awareness press”).

  • You may just ask for another keypress when they failed to inhibit using an inline_script.
    See here http://osdoc.cogsci.nl/3.1/manual/python/keyboard/

    if # define your condition e.g. var_correct=0:
            kb= keyboard(keylist = ['b'], timeout=1600)
            key, time = kb.get_key()
    
  • @DahmSF But the inter stimulus interval needs to be strictly 1600, only in that time window two responses should be collected.

  • Hi,

    Is this code what you want?


    kb = keyboard() # first response start_time1 = clock.time() k1,t1 = kb.get_key() if k1 != None: response_time1 = t1-start_time1 k2,t2 = kb.get_key(timeout=1600) if k2 != None: response_time2 = t2-t1 else: response_time2 = None

    Eduard

    Buy Me A Coffee

  • @eduard could you plz explain how does this code makes sure that both k1, and k2 combined has a time out of 1600ms. and sorry for posting the question twice. i realized it little late. ive been struggling to make this work for quite sometime. thanks for your time.

  • The line

    k1,t1 = kb.get_key() waits for a keyboard response (unlimited). Once a response is done, k2,t2 = kb.get_key(timeout=1600) will wait for the second response, but only for 1600ms. Is this what you want?, or do both response have to occur within 1600 ms?

    Buy Me A Coffee

  • edited February 2017

    i want the latter, both the response to occur within 1600 ms
    kb = keyboard(keylist=['z','m'], timeout=1600) k1,t1 = kb.get_key() k2,t2 = kb.get_key() if k1 != None: response_time1 = t1-start_time1 k2,t2 = kb.get_key(timeout=1600) if k2 != None: response_time2 = t2-t1 else: response_time2 = None
    is this the way to make it work?

  • it would be really helpful if some one can point me to the solution as nothing seems to work out for me. so far my experiment yields correct and incorrect responses on GO and NO GO trials. But I also need to register the first response they make on no go trials by mistake which is followed by second error awarness response 'm' to indicate that they have made an error. both these responses are collected within 1600 ms ISI. (on no go trias)I need both the first and second response RT's and also second response RT measure relative to the first one.I'm attaching the opensesame file here.

  • Hi,

    kb = keyboard(keylist=['z','m'])
    start_time = clock.time()
    k1 == None
    while clock.time()-start_time < 1600:
        if k1 == None:
            k1,t1 = kb.get_key()
        elif k1 != None:
            k2,t2 = kb.get_key()
        if k2 != None:
                break
    
    # compute response time
    # adjust to the times you want
    if k1 != None:
        response_time1 = t1-start_time
    else:
        response_time1 = None
    if k2 != None:
        response_time2 = t2-t1
    else:
        response_time2 = None
    

    Eduard

    Buy Me A Coffee

  • @eduard im getting a error message that k1 is not defined. I also would like to know the reason for k being set to none initially.

  • Hi,

    Replace the line k1==None with k1= None

    Eduard

    Buy Me A Coffee

  • edited February 2017

    @eduard I did and it gave a error that key 2 is undefined. so I set key 2= none. I have two issues,first problem is that it waits for a key response to move onto the next one.as these are no go trials i want it to just stay for 1600ms and register the responses k1 and k2 only if subjects do press them. if no keys were pressed it should move to the next one after 1600 ms. second problem that im facing is defining my correct response based on key 1. if they successfully withhold pressing any key.correct needs to be set to 1.

  • Ah dammit,

    I forgot to change that. So, replace kb = keyboard(keylist=['z','m']) with kb = keyboard(keylist=['z','m'],timeout=0)

    The second question you can solve by comparing the conditions to the expected key persses, for example:

    if condition == 'nogo':
        if k1 == None:
             correct = 1
         else:
              correct = 0
    
    elif condition == 'go':
        if k1 == 'z':
             correct = 1
         else:
              correct = 0
    

    Of course you need to adapt it the way you want.

    Eduard

    Buy Me A Coffee

  • edited February 2017

    1)They key1and key2 are not being logged in the output excel form. so i added exp.set("key1",k1)
    exp.set("key2",k2) to the inlinescript but it shows only NA under the key 1 and key 2 column.
    2) when i ran the code i realized that after pressing k1 it moves on to the next stimuli, it doesnt wait for the remaining of 1600 ms to get key2.
    I dont have much experience in programming. could you explain what below code is for? rest i understand.
    if k1 == None:
    k1,t1 = kb.get_key()

  • I made few changes and now both the keyboard responses appears in the log file but key2 value is not being collected instead it shows none for every trial. I'm not sure whether its because of the change i made to the code. It would be great if any one can spare some time and correct me if i'm wrong. I'm a novice and have very little experience with programming.

    kb = keyboard(keylist=['z','m'],timeout=0) start_time = clock.time() var.response1=None var.response2=None while clock.time()-start_time <1600: if var.response1 == None: var.response1,t1 = kb.get_key() elif var.response1 != None: var.response2,t2 = kb.get_key() if var.response2 != None: self.sleep(1600-(t1+t2))
    `

  • Nice. You're almost there. The current issue is that your if/else statements are not stringent enough. Consider this fix:

    kb = keyboard(keylist=['z','m'],timeout=0)
    start_time = clock.time()
    var.response1=None
    var.response2=None
    while clock.time()-start_time <1600:
        if var.response1 == None:
            var.response1,t1 = kb.get_key()
        elif var.response1 != None and var.response2 != None:
            var.response2,t2 = kb.get_key()
        elif var.response2 != None:
           pass # this won't do anything. 
        # at this point you just wait until the loop is over, you don't need to make a special wait statement.
    

    Buy Me A Coffee

  • thank you so much. one last doubt. i have attached a screenshot of my excel form. one problem with the output is that response 1 and response 2 are being logged even on go trials though i have set the inline script to run oly if [go]=1 i have highlighted the trials where error was made as yellow and the correct withhold trials in green

  • [go]=1, means that it is executed only when the trial is a go trial, nogo trials will not be executed. Your excel sheet is perfectly in agreement with that. If you want it to be executed only on NoGo trials, you have to set [go]!=1.

    Buy Me A Coffee

  • @eduard im sorry.i meant even when i set it as [go]=0/[go]!=1 the problem persists

  • I don't think this is a problem per se. As you can see in the file, there are no new responses given. For every time you encounter a logger in your experiment, Opensesame writes a line to the logfile with all variables that are currently defined. Your response variables are present so they will be written to the file. When you analyse your data, you wouldn't include this trial anyway, so I don't see how it would interfere. If you really want to get rid of the values, you can reset your variables (either in the beginning or the very very end of your loop to be None, so that the previous entry does not carry over to the next trials (as you can see z, 202,m,702, are written for a couple of trials in a row, only because it still exists in the variable space).

    Does this make sense?

    Edaurd

    Buy Me A Coffee

  • @eduard
    yea makes sense. but i'm not sure how to reset the variables. do i need to use a separate inline for that and what function i should use to reset.?

  • As long as it does not happen between responding and logging, any place is good, does not matter whether you use a separate inline or an existing one. You can rest a variable by giving it a default value: var.k1 = None

    Buy Me A Coffee

  • @eduard thank you again for being so kind and patient. works fine. o:) I feel relieved finally.

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