Howdy, Stranger!

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

Supported by

[solved] How to create different feedback delay for each response key?

edited August 2013 in OpenSesame

Hi

I want to thank you for the great help I have got from you with my previous problems.
I want to make some changes in the previous experiment programmed at OpenSesame.
The experiment has four response keys. Clicking on each key leads to a flash (sketchpad) on the screen immediately.

Is there a way that the flash will appear after different delay for each of the four keys?
For example, after pressing the "h" key, a flash will appear after 300 milliseconds, after pressing the "d" key, a flash will appear after 600 milliseconds etc for the remaining two keys.

if necessary, i would be happy to share with you the experiment files through DropBox. If so, what is your address?

Thank you for your help
Noam

Comments

  • edited July 2013

    Hi Noam,

    Yes, that's certainly possible! To make the response-flash interval depending on the given response:

    Firstly, place an inline_script item between the keyboard_response item and the flash:

    image

    Secondly, place the following Python code in its Run phase tab (see comments for more information):

    # Determine the delay between response and feedback item
    # depending on the given response:
    
    # To determine the given response, we use the built-in OpenSesame
    # function 'self.get()'. See also:
    # http://osdoc.cogsci.nl/python-inline-code/experiment-functions/#experiment.get
    
    # If keyboard responses that do NOT appear in the if-statements below ARE
    # allowed to be given, first make sure your experiment doesn't crash 
    # if a different response is given. You can do this by giving 
    # the variable 'delay' (which we'll use to pause the 
    # experiment) a starting value:
    delay = 0
    
    # If a certain response is given ...
    if self.get("response") == "a":
        # ... declare the corresponding delay in ms:
        delay = 300
    if self.get("response") == "b":
        delay = 600
    
        # Etc. for the other responses
    
    
    # Set the response for future use in the GUI (e.g. for
    # your logger item) by using the 'exp.set()' function.
    # See also:
    # http://osdoc.cogsci.nl/python-inline-code/experiment-functions/#experiment.set
    
    exp.set("delay", delay)
    
    # Pause your experiment for the desired delay by using the built-in OpenSesame
    # function 'sleep()'. See also:
    # http://osdoc.cogsci.nl/python-inline-code/experiment-functions/#experiment.sleep
    self.sleep(delay)
    

    Does this answer your question?

    Best wishes,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 6:12AM

    it works great!
    thank you!
    Noam

  • edited 6:12AM

    Great to hear!
    Don't hesitate to post any further questions you may have!

    Did you like my answer? Feel free to 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