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 set my output to 1,2,3

edited August 2014 in OpenSesame

Hello all,

I am trying to make a simple questionnaire.

-each question has two options, for example: A. Cat or B. Dog

  • when i "logger" the response, the output is exactly that: "A. Cat"

--> i would like for the out put to be 0's and 1's

how do i set it up so that the output is a 0 for when answered A, and a 1 for when the participant answers B ?

please help

thank you :)

Comments

  • edited 8:21PM

    Hi,

    What you could do is create a new variable, let's call it recoded_response, that basically the maps the original response ('A. Cat') to a recoded value (0). A simple script like the one below should do the trick. This should be in the run-phase of an inline_script that directly follows the form. See the code comments for an explanation.

    Cheers!
    Sebastiaan

    # A dictionary with the original responses as keys, and the recoded
    # responses as values.
    response_codes = {
        'A. Cat' : 0,
        'B. Dog' : 1
        }
    # Get the original response, assuming that `response` is indicated as
    # response variable in your form.
    original_response = self.get('response')
    # Give an informative message if the original response is not listed
    # in the response codes. This is a sanity check in case we make a
    # typo etc.
    if original_response not in response_codes:
        raise Exception('Don\'t know how to recode %s' % original_response_)
    # Set a new variable, called `recoded_response` with the recoded
    # response.
    exp.set('recoded_response', response_codes[original_response])
    
  • edited 8:21PM

    phenomenal ! Thank you Seb...

    one more question: how can i centre the Form_multiple_choice plug in?
    i would like the radio button options to be presented in the middle(centre) of the screen vs. Left

    thanks

  • edited 8:21PM

    Hi,

    The form_multiple_choice plug-in does not allow you to center the radio buttons. However, if you want more flexibility, you can always create your own custom form using the form_base plug-in. That's not too difficult and is described here:

    Cheers!
    Sebastiaan

  • edited August 2014

    Seb! this application is amazing! i feel like a computer programmer ! so smart! lol

    one more question seeing as youre soo amazingly helpful!

    how do i do a dynamic display?
    simple design of a bar which increases as the number of key presses increases.

    let me know.
    thanks

  • edited 8:21PM

    Hi,

    If you want to implement these kinds of dynamic stimuli, you'll have to use Python scripting. You will find various discussions on this forum, showing sliders, etc. For example here:

    This shows the general idea, and should help you get started, but obviously it's not exactly what you need. So what I would is first walk through a Python tutorial to get a basic understanding of Python, and then try to implement your growing bar, possibly based on code snippets here on the forum.

    If you get stuck, feel free to ask. But make sure to provide enough detail so that it's clear what exactly you want to achieve, what you've done so far, and why it doesn't work as you'd like.

    Cheers!
    Sebastiaan

  • edited 8:21PM

    thx

  • edited 8:21PM

    Marking this as solved. For potential questions on the dynamic display, please open a dedicated thread (so that it can be found more easily for reference later on).

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