Howdy, Stranger!

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

Supported by

Multicharacter keyboard input + German characters (Umlaute)

edited January 2021 in OSWeb

Hi @sebastiaan and all,

I have successfully managed to capture multicharacter keyboard responses in OSWeb using inline_javascript. However, some German characters cannot be inserted (namely: ä, ö, ü and ß).

Is there a way to extend my code to allow the participants to insert these characters or are the only allowed keys the ones listed in the available key list? Thanks for your help!

Best,

Cleo

Comments

  • Hi @Cleo,


    I can't think of an easy solution for this, sorry. @sebastiaan or @eduard , do you have an idea?


    Cheers,


    Lotje

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

  • Hi @Cleo and @lvanderlinden ,

    The only way I could think of doing this is by bypassing OSWeb altogether. The script below (and the attached experiment) shows how you can programmatically add a real HTML form, temporarily disable OSWeb, collect the input through the form, and the re-enable OSWeb again. This is actually a pretty promising approach that may be more generally useful to collect form input in OSWeb.

    --- Sebastiaan


    function accept_input() {
        // This function is called when the ok button is clicked. It makes
        // OSWeb visible again, restores the key handlers, hides the form,
        // and sets the form response as custom_form_input.
        custom_form.style.display = 'none'
        osweb.style.display = 'block'
        vars.custom_form_input = document.getElementById('input_text').value
        window.addEventListener('keydown', runner._events._keyDownHandler)
        window.addEventListener('keyup', runner._events._keyUpHandler)
    }
    
    // Create a div with a custom HTML form, and append it to the document
    let custom_form = document.createElement('div')
    custom_form.style = 'background-color: gray; height: 100%; text-align: center;'
    custom_form.innerHTML = '<h1>Hi there!</h1><input type="text" id="input_text"><input type="button" id="input_ok" value="ok">'
    document.body.append(custom_form)
    // Hide the element that shows the regular OSWeb content
    let osweb = document.getElementsByClassName('justify-content-center')[0]
    osweb.style.display = 'none';
    // Remove the OSWeb key handlers, because otherwise OSWeb will keep responding
    // to the input to the form.
    window.removeEventListener('keydown', runner._events._keyDownHandler)
    window.removeEventListener('keyup', runner._events._keyUpHandler)
    // Call accept_input() when the Ok button is clicked
    document.getElementById('input_ok').onclick = accept_input
    
  • Hi Sebastian,

    I am using your solution, and it works fine (thanks!), except when I use this script twice in a row (two inline_javascript) to get, say, the age and the nationality of participants. In that case, the first from input works fine, but then it freezes on the second one: the form appears as it should be, but nothing happens when I click on the "ok" button, so the experiment is stuck.

    Any idea why is this happening ?

    Thank you very much !

  • Hi again,

    Just found it, had to rename the id's of the html form !

    Thanks, Best !

  • HI @sebastiaan ,

    I use this code for a memory experiment in Hebrew. In my experiment, this code appears in a loop, so the subjects could type few words, one by one, until the time is over.

    It works great until I export the subjects results from JATOS. It looks like opensesame saved only the first word that was typed.

    I can't get over it... the logger is in the correct place as well.

    Maybe do you have some idea how can I solve this problem?


    Thank you!

  • Hi @zohar ,

    Could you upload the experiment here (or a simplified that illustrates the issue) so that I can take a look?

    — Sebastiaan

  • @zohar Right, I see. I don't fully understand the structure of the experiment, i.e. what the two nested loops correspond to. But I suspect that the logger should be part of now_word_seq (and not recall_seq_1_2) so that it's executed after each time that a response is collected. Could that be it?

  • Hi,

    Thank you for your answer.

    I already tried it but it does not work... I also tried to delete one loop and leave just one.

  • edited August 2021

    @sebastiaan Hi again,

    I tried to do few things and I think the problem is in the HTML code.

    First, I changed the HTML code to a multichar response (typed in English) and the data was saved well.

    Second, in the response loop there is also a rating scale and his data also saved correctly.

    Maybe I need to change something in the HTML code to save all the words and not only one?

    I have been working on this experiment for 4 months and am a little desperate ...

    I am really appreciate your help,

    Zohar.

  • @zohar I just released a test version of OSWeb 1.4. This provides much better support for text input (including non-Latin characters). This should allow you to simplify your experiment considerably, thus hopefully also resolving this issue.

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