Howdy, Stranger!

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

Supported by

Struggling to define acc for feedback

edited June 2020 in OpenSesame

My experiment is an oddity task where a participant hears three sounds and click on the circles that lit up with the sound that was the odd one out. The cursor_roi are coded as 'left', 'centre' and 'right' for the positions of the circles.

After the mouse click response I have used the inline script below, which successfully runs feedback after each trial.

if var.target_visual in var.cursor_roi:
    var.correct = 1
else:
    var.correct = 0

However, I want to give feedback at the end of the block with acc% but I cannot figure out how to define the variable. I tried adding the variable 'correct_response' to the block loop, however when I use 'left', 'right' and 'centre' or [target_visual] in order to correspond to the correct roi the experiment no longer runs and says that they are invalid.

Could you let me know where I'm going wrong?

Comments

  • From what I can see, the problem might be that var.acc source is a keyboard response, but I can't figure out why or how to change it to the correct mouse response.

  • Ok, so now it just seems to reject the possibility of 'centre' being a correct response...

  • edited June 2020

    Apologies for continued updates. I have managed to change it to the mouse response and changed the inline script to:

    if var.target_visual == var.cursor_roi:
       var.correct_response = 1
    else:
       var.correct_response = 0
    

    While this does now calculate an accuracy score, the score is inaccurate (ironically). For example, if I get 3 out of 6 incorrect it sometimes reports 60% accuracy and other times 40% accuracy, depending on the order of the correct or incorrect answers.

  • Hey,

    I can't say for sure what the problem is, but you can simply create your own accuracy variable. All you need is a variable that counts the total number of trials, and one that counts the total number of correct responses. Divide one by the other et voila, you have your accuracy.

    # every time you want to reset your accuract, 
    # but at least once in the beginning of the experiment, 
    # initialize a variable for the total number of correct trials and trial count
    var.total_correct = 0
    var.total_trials = 0
    
    

    In a different inline_script:

    # update those counters based on the responses
    if var.target_visual == var.cursor_roi:
       var.correct_response = 1
       var.total_correct += 1 
    else:
       var.correct_response = 0
    var.total_trials +=1
    

    In a different inline_script:

    # compute accuracy
    var.accuracy = var.total_correct/var.total_trials
    
    # if you use Python 2, you should use float variables
    var.accuracy = float(var.total_correct)/var.total_trials
    

    Then you can use the variable var.accuracy, just like var.acc


    Hope this helps!

    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