Howdy, Stranger!

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

Supported by

[solved] Greek in Text input item

edited January 2014 in OpenSesame

Dear Sebastiaan,

I am Paul. We spoke a while back. I finally found time to program my experiment. My experiment is simple. Students will see a a number of Greek words and will be asked to make a verbal response to them (the first word that comes to their mind) and then to write that response in Greek. My primary question is the following: Can languages other than English be input? Can I use Greek? The text input item does not seem to allow this. I hope their is a solution to this because I am starting to like the program!
One other question I have is what is the best way to collect verbal response time? Should I use a voice key box or will a microphone be enough? Does opensesame accept voice key devices?

Many thanks!
Paul

Comments

  • edited 1:40AM

    Hi Paul,

    I'm a bit embarrassed, but it doesn't immediately come to mind where we met. Was it at a conference?

    With respect to your question. The text_input item does indeed not support non-latin alphabets (unfortunately), but the questionnaire plug-ins should, although this hasn't been extensively tested yet. Maybe the open_question plug-in does what you need? See here: http://osdoc.cogsci.nl/plug-ins/questionnaire-plug-ins

    With regard to the collection of a voicekey. One way is to use a microphone and detect the onset of a sound as described in this topic: http://forum.cogsci.nl/index.php?p=/discussion/6. A voicekey box should work as well, in which case you will have to listen to the parallel/ serial port (if you're on windows the port_reader plug-in will take care of that). A voicekey box will give you much better temporal precision, but on the other hand recording from the microphone will give you more options. Both methods should work though.

    Good luck!

    Cheers!
    Sebastiaan

  • edited 1:40AM

    Dear Sebastiaan,

    Thanks for your prompt reply to my questions. When I said "spoke", I meant through this forum.
    I tried your suggestions with the questionaire plug ins, but to no avail. They refuse to accept Greek. If you ever rework non Latin alphabets into open sesame code, please post it on your site.

    Once again, thanks for your effort.

    Best,
    Paul

  • edited January 2014

    Hi Paul,

    You're right, I tested it with some mathematical operators and such. This worked, but real Greek is not accepted. If you're still interested you could try the following script, which should accept non-western alphabets. It works pretty much like a normal text_input plug-in, but see the code comments for more info.

    Cheers!
    Sebastiaan

    # ABOUT
    # This script collects multi-character text input
    # and draws the response on top of a sketchpad.
    # Unlike the text_input plug-in, this script should
    # be unicode sensitive, so it should be able to deal
    # with Greek, Hebrew, Arabic, Chinese characters, etc.
    #
    # USAGE
    # Put this script in the run phase of an inline_script
    # item at the place where you want to collect the response.
    # Make sure that you have a sketchpad with the name
    # specified below as src_sketchpad that precedes this
    # script and has a duration of 0. The response will be
    # drawn on top of this sketchpad. 
    
    # Import required modules
    from openexp.canvas import canvas
    import pygame
    from pygame.locals import *
    from PyQt4.QtCore import QString
    
    src_sketchpad = 'my_sketchpad'
    
    # Collect keys until return is pressed and draw
    # the response over the canvas from src_sketchpad
    my_canvas = canvas(self.experiment)
    resp = ""
    accept = False
    while True:
        for event in pygame.event.get():
            if event.type == KEYDOWN:
                if event.key == pygame.K_ESCAPE:
                    raise Exception()
                elif event.key == pygame.K_RETURN:              
                    accept = True
                else:
                    resp += event.unicode
        if accept:
            break
        my_canvas.copy(self.experiment.items[src_sketchpad].canvas)
        my_canvas.text(resp)
        my_canvas.show()    
    
    # Save the response as experimental variable 'response' 
    resp = exp.usanitize(QString(resp))
    self.experiment.set("response", resp)
    
  • edited 1:40AM

    I'm sad to discover that this issue doesn't seem to have been (really) solved after these years.

    To explain myself, I mean that although Sebastiaan has given a type of solution to the problem -using the canvas of a Sketchpad item through an inline script- there is still no way to support unicode in a Form Text Input item. For instance in an experiment that we're building for a class, we use such an item in a loop to present all the questions of a certain type -selected using a [qtype]=oc variable value in the "Run if" condition of the form- and we're trying to use the functionality of the Form Text Input to collect user input for these open questions. Sadly Greek (as other non-latin languages) are not supported in the text input.
    I couldn't find a way to make the sketchpad item to work in a similar way in the scenario described above (or similar ones), no matter how hard I searched through the code (I'm not an expert on the subject though).

    Isn't there anything we can do for the situation?

    (I modified a little the above code in order to accept backspace deletion. I'm only presenting the relevant part:

    (...)
        for event in pygame.event.get():
            if event.type == KEYDOWN:
                if event.key == pygame.K_ESCAPE:
                    raise Exception()
                elif event.key == pygame.K_RETURN:              
                    accept = True
                elif event.key == pygame.K_BAKCSPACE:
                    resp = resp[0:-1]
                else:
                    resp += event.unicode
    (...)
    

    )

  • edited 1:40AM

    Isn't there anything we can do for the situation?

    As it happens, the issue should be resolved as of 2.9.0~pre28.

    Cheers!
    Sebastiaan

  • edited 1:40AM

    Just perfect!! Dear Seabastiaan, I just tried the current prerelease! Indeed, the problem seems to have been solved!!

    Thank you very much!

    (there remains only a minor consideration with accent diacritical mark but this is not really an 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