Howdy, Stranger!

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

Supported by

[solved] 1-digit-constrained visual feedback on Likert-scale questions until Return is pressed?

edited March 2013 in OpenSesame

I'm trying to use loops to administer a bunch of Likert-scale questionnaires to participants. I have looked at the multiple-choice plugins which are really slick, except that (a) I haven't figured out yet how to interpret the data files they generate, and (b) I'm afraid that 300 questions with their mouse interface will give my participants carpal tunnel syndrome. Instead, if possible, I'm trying to present the questions, with text drawn from a variable in a loop, on a sketchpad, with the response options (e.g., 1 2 3 4 5 6 7). The participant's answer is constrained to a single digit, from 1 to 7. So far so good, except that I would like the participants to see feedback for the answer they have chosen (e.g., the number the pressed showing up in the center of the screen or something), and that feedback should change if they press another key (e.g., their initial choice of 2 is replaced with 3 when they press the 3 key), and then the last choice should be written to the data file only when they press Return, which should advance them to the next item in the sequence.

Right now, in the trialsequence, I have (a) a sketchpad object with a reference to a variable with the question text, as well as a non-variable indication of the response options, (b) a keyboard response object with Allowed Responses as 1;2;3;4;5;6;7, and (c) a logger set, I think, to default values.

I feel I see very nearly the solution I need here:

http://forum.cogsci.nl/index.php?p=/discussion/31/solved-multi-character-keyboard-response-or-simultaneous-sketchpad-and-text_input/p1

except I'd like the keypress to be constrained to one digit, and have the visual feedback change in response to keypresses (only the allowed ones) indefinitely until Return is pressed. I've searched the forums, but haven't found anything so far. If I'm missing a post, I'd be happy to be referred to it. I know nothing about Python, so I haven't been able to work out, yet, how to get scripting to do what I'd like, but I'm willing to learn...

Any ideas?

Comments

  • edited 6:47PM
    I have looked at the multiple-choice plugins which are really slick, except that (a) I haven't figured out yet how to interpret the data files they generate

    They will set the response variable. So the idea is that you insert a logger after the collection of each response, and you will get a .csv spreadsheet where the responses are logged in the response column.

    I'm afraid that 300 questions with their mouse interface will give my participants carpal tunnel syndrome.

    That fear seems justified.

    I adjusted the script from the post you mentioned a bit. Again, you need to insert a sketchpad called my_sketchpad somewhere, such as right before the inline_script (with a 0 duration). The script below accepts only numeric responses 1-7, shows the current response, and accepts the response on 'return'. Is that about what you were looking for?

    from openexp.canvas import canvas
    from openexp.keyboard import keyboard
    my_canvas = canvas(self.experiment)
    my_keyboard = keyboard(self.experiment, keylist=['1','2','3','4','5','6','7', 'return'])
    resp = None
    while True:
        # Get a keyboard response
        key, time = my_keyboard.get_key()
        # keyboard.to_chr() converts the keycode to a description,
        # like 'space' or 'return'. If return is pressed the loop
        # should be exited, but only if a response has been given
        if my_keyboard.to_chr(key) == "return":
            if resp != None:
                break
            else:
                continue
        # The built-in my_keyboard.to_chr() converts the keycode to a character,
        # like '1' and '2'.
        resp = my_keyboard.to_chr(key)
        # Copy the canvas from a sketchpad called 'my_sketchpad' and
        # overlay the response
        my_canvas.copy(self.experiment.items["my_sketchpad"].canvas)
        my_canvas.text(resp)
        my_canvas.show()    
    # Save the response
    self.experiment.set("response", resp)

    For more information on the functions, see:

  • edited 6:47PM

    Thank you! That's exactly what I needed. I tweaked the feedback-text displayed just a little (position, color), and now it's amazing. I very much appreciate your help.

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