Howdy, Stranger!

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

Supported by

reponse time only for correct response

How I can get average response time only for correct responses?


  • Hi dn,

    you may use the correct_response variable and write an inline_script for this.

    For instance you may calculate the median (remember that RTs are not normally distributed) like this

    if var.correct_Resp==1:
  • Thanks DahmSF but I don't know how to use inline_script . Can you suggest me an easy mode to obtain my request or to explain me step by step what have to do ? Then, I need mean response time of correct responses not the median... I hope to solve this "simple" problem in short time .

  • Hi dn1,

    Do you need the RTs in the experiment, or only during data analysis? If the latter, I would suggest you don't bother to implement average RTs inside Opensesame, but only do it in the data analysis in whichever software you use.

    but I don't know how to use inline_script .

    In this case, I would recommend you do a tutorial on Python. Inlinescripts are just items in which you can script your experiment directly without using pre-made items (like sketchpads, samplers, loggers, etc). Under the hood, most of the processes in Opensesame are based on Python. The computation of average response time is no exception to that.

    Can you suggest me an easy mode to obtain my request or to explain me step by step what have to do ?

    In order to only show correct RTs, you have to keep track of the accuracy of a response and its delay. To do so, you need a response. Therefore, you have to put your inline_script after the keyboard_response. More specifically, the code to compute RTs have to be in the run phase of the inline_script, because in the prepare phase no response has yet been given (see the docs for details). The actual code that you need to do is something like this:

    if var.correct == 1:
         var.total_correct_response_time += var.response_time
         var.trial_no_correct += 1

    Essentially, this adds the current RT to all RTs, only if the response was correct.

    Additionally, you need to do 2 things.

    1) Initialize the variables var.total_correct_response_time and var.trial_no_correct. As you use it in the script, it needs to exist first. To create it, you can simply put another inline_script in the beginning of the block loop (or experimental loop depending over which period you want to compute the RTs) and put in the prepare phase this code: var.total_correct_response_time=0and likewise for the other variable

    2) Compute average RTs, based on this new variable. This can easily be done with this code, placed in another inline_script at the end of the block or the experiment:

    var.avg_correct_response_time= var.avg_correct_response_time/var.total_no_correct

    This new variable you can then add to the feedback item.

    Does that make sense?


    Buy Me A Coffee

  • Thanks for the answers but let me explain better whati I find . If I use the item "feedback" I get the percentage of accuracy and the average response time calculated on all the answer of a group of trial. Instead I want opensesame give me the percentage of accuracy and the average latency time calculaated only on the correct responses. What can I do?

  • Hi,

    You need to do what I described in the previous post. Computing new variables that are based on correct and not all responses. From the 2. quote onwards I was giving instruction as to how present RTs of only correct variables. So, how about you try to follow these instructions?

    Good luck,



    "accuracy and the average latency time calculaated only on the correct responses"

    accuracy of only correct responses is always 100%

    Buy Me A Coffee

  • Hi dn1,

    to make it easier for you:

    Try to use this code in your inline script. One script should be enough. You may then access the variable var.avg_correct_response_time in any feedback item after that inline_script.

    if var.correct == 1:
         var.total_correct_response_time += var.response_time
         var.trial_no_correct += 1
         var.avg_correct_response_time= var.total_correct_response_time/var.total_no_correct



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 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