Howdy, Stranger!

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

Supported by

auto response mode doesn't work anymore

edited January 2017 in OpenSesame

Hi and a happy new year to all of you!
For some reason the auto response mode doesn't work for me anymore. It's been some time since I last used it, so i can't tell since when it stopped working.
Problem occurs with different experiments and in all three "Run" modes.

Any ideas? I am designing a new experiment, which needs some testing. I'd kill (or finally translate missing .md's to German :tongue: ) for auto response mode...
Best,
timo

System
System: Windows
Architecture: 32bit
Modules and packages

OpenSesame 3.1.4
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jun 29 2016, 11:42:13) [MSC v.1500 32 bit (Intel)]
QProgEdit 4.0.6
datamatrix 0.3.1
qdatamatrix 0.1.9
pseudorandom 0.2.2
fileinspector 1.0.2
QNotifications 1.1.1
QOpenScienceFramework 1.1.8
opencv [not available]
expyriment 0.8.1.opensesame2
IPython 4.2.0
numpy 1.11.1
scipy 0.17.1
PIL/ PILLOW 1.1.7
psychopy 1.82.01
pygame 1.9.2a0
pygaze 0.6.0a21
pyglet 1.2.4
PyQt 4.11.4
serial 2.7
markdown 2.6.6
bidi 0.4.0
yaml 3.11

Comments

  • Hi Timo,

    Right, auto-response has been removed in 3.1. This release included a reworked way to handle responses, and the old (awful) implementation of auto-responses was removed as a part of this. I do want to re-introduce this in the 3.2 series though. But for the immediate future, all I can promise is that I will remove the defunct menu item!

    Any ideas? I am designing a new experiment, which needs some testing. I'd kill (or finally translate missing .md's to German :tongue: ) for auto response mode...

    For now, you can monkey-patch the keyboard class to return a dummy response ('a') right away by putting the following code in the prepare phase of an inline_script at the start of the experiment (replace legacy by the backend that you're using):

    from openexp._keyboard.legacy import legacy as legacy_keyboard
    
    def auto_get_key(*args, **kwargs):
        return 'a', clock.time()
    
    legacy_keyboard.get_key = auto_get_key
    

    And now get translating! :wink:

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • Hi timo and sebastiaan,

    Does this mean that, with that code I can "fake" a keyboard response and get a sketchpad to end (that has been set to "keypress"), without having to press any actual key?

    Regards,
    Javi

  • Hi Javi,

    Yes, it does. It basically overrides the real keyboard.get_key() with a custom function that simulates an immediate key press.

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • edited January 2017

    Thanks sebastiaan!

    This will be very useful for me. However, i'm having problems getting it to work.

    On one hand, OpenSesame doesn't recognize the module "xpyriment" when I use the same code you posted but with Xpyriment:

    from openexp._keyboard.xpyriment import xpyriment as xpyriment_keyboard
    
    def auto_get_key(*args, **kwargs):
        return 'a', clock.time()
    
    xpyriment_keyboard.get_key = auto_get_key
    

    On the other hand, I'm not entirely sure how to trigger this dummy response. Could it be something like this or does it work in another way?

    for event in pygame.event.get():
            if event.type == pygame.KEYUP:
                auto_get_key
    

    Thanks a lot for your help!
    Regards
    Javi

  • Thanks again, Sebastiaan!!!
    My word is my bond!

  • On one hand, OpenSesame doesn't recognize the module "xpyriment" when I use the same code you posted but with Xpyriment:

    Ow right: The xpyriment backend actually uses the legacy keyboard backend. Each backend is a predetermined combination of a canvas backend, keyboard backend, etc. If you click on backend settings in the General Properties tab, you will see which backends are actually used.

    On the other hand, I'm not entirely sure how to trigger this dummy response. Could it be something like this or does it work in another way?

    You don't need to trigger it: That's the idea of auto-response! The only thing that you need to do is add this code to your experiment.

    Buy Me A Coffee

  • Thanks a lot sebastiaan! I wonder if there could be any way to customize this auto-response. I'd like to only use this auto-response in a specific loop and not in the whole experiment and, if posible, only apply the auto-response in specific cases and not with all keyboard_responses.

    If I try to put the inline script in a given loop it only works from that loop on, but I don't know how to stop it for the other loops and trials of the experiment.

    I'm sorry if all this has a very simple answer, but I'm still kind of new to programming.

    Regards
    Javi

  • Hi Javi,

    You can re-enable responses by restoring the original get_key() function. So if you use this script to enable auto responses:

    from openexp._keyboard.legacy import legacy as legacy_keyboard
    
    def auto_get_key(*args, **kwargs):
        return 'a', clock.time()
    
    legacy_keyboard.original_get_key = legacy_keyboard.get_key
    legacy_keyboard.get_key = auto_get_key
    

    Then you can use this script to revert back to normal responses:

    legacy_keyboard.get_key = legacy_keyboard.original_get_key
    

    Do you see the logic?

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • Thank you very much Sebastiaan!
    Yes, I see the logic and it works like a charm!

    Regards
    Javi

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