Howdy, Stranger!

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

Supported by

Dependent Multiple Choice questions

Hello,

I'm currently setting up a questionnaire in OpenSesame. It contains some Multiple Choice questions that are dependent from each other in the following sense:

I have a question “1”. Possible answers are "a", "b", "c", "d". Now if the subject selects "a", the experiment continues with question 2. If the subject selects answers "b", "c" or "d", then a question 1b must be answered.

A picture of the sequence to make it more clear:

I tried to solve this problem with inline scripts the following way: I made an overall sequence which contains many sequences. Those all contain a single inline script with either a question 1, 2, 3, etc. or a question 1, 2, 3 AND a question 1b, 2b, 3b, etc. These "b-items" are only presented when the previous question was answered with “b”, “c”, or “d”. So far, so good. The problem I have now is that the question that has been answered already is displayed completely new (the subject has to answer it again, first answer is overwritten). What I would like to have is that the participant’s answer to the first question (the one which he already answered and led to the display of the “b”-question) is already selected on the page where the “b”-question appears. So that it looks as if it wasn't a new page but the "b-item" is displayed on the same page additionally.

This is the code I am using in the "b-items":

def form_validator(): 
        options = [0,1,2,3]
        return var.q01b in options
 
title = Label(text=u'title')
 
q1 = Label(text=u'question1', center=False)
q2 = Label(text=u'question1b', center=False)
 
ratingScale1 = RatingScale(
        var=u'q01',
        nodes=[u'a', u'b', u'c', u'd']
)
ratingScale2 = RatingScale(
        var=u'q01b',
        nodes=[u'a', u'b', u'c', u'd']
)
 
nextButton = Button(text=u'Weiter')
 
 
form = Form(validator=form_validator, rows=[1,1,1,1], cols=[4,7], margins=(10,40,10,40), spacing=25) 
form.set_widget(title, (0, 0), colspan=2)
form.set_widget(q1, (0, 1)) 
form.set_widget(ratingScale1, (1, 1))
form.set_widget(q2, (0, 2)) 
form.set_widget(ratingScale2, (1, 2))
form.set_widget(nextButton, (0, 3), colspan=2)
form._exec()

Is there any solution to this problem? Thank you in advance,

Nicole

Comments

  • Hi Nicole,

    I think the easiest solution is to abandon the sequence structure and have all the elements within a single inline_script (that is within a single trial, across trials you can still use an inline_script)

    Like you already do, prepare all the questions in advance, but on separate forms and execute the first one, once a response has been given check the answer and if the variable is '0' move on to question 2, if not, go on to question 1b. This should keep it simple, but still implements the functionality you want.

    By the way, I don't think you need a form validator.

    Does that make sense, or do I misunderstand you?

    Eduard

    Buy Me A Coffee

  • Hi Eduard

    Thank you for your fast reply! This is what I did first but it is rather important to us that the first and the "b-item" are displayed on the same page.

    I also tried to put the first and the "b-item" into the same inline script but it didn't work beacause of the following reason: I can only check whether the b-item should be displayed after the first item was executed and the participants chose their answer. Afterwards I would have to set up a new form, which would lead to the same problem as described above.

    I need the form validator since we want to prevent people from clicking the next button without answering a question. Or did I miss something there?

    Regards,

    Nicole

  • Hi Nicole,

    I can only check whether the b-item should be displayed after the first item was executed and the participants chose their answer.

    In this case, you are right. You will need to first execute one form without the b-item, once the participant responds the "right" thing, you make the same form again, but add the b field to it, and show it. I think you know how to add that, right? I also think you can set the default option that is shown (the "default" argument?) to the response that triggered the B-item.

    I need the form validator since we want to prevent people from clicking the next button without answering a question.

    Oh, okay, yeah that makes sense maybe.


    Eduard

    Buy Me A Coffee

  • Hey Eduard

    The default option was exactly what I was looking for!

    Thank you for your help.

    Regards,

    Nicole

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