Howdy, Stranger!

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

Supported by

Advance only to the next item when a selection has been made

Hi everybody,
in my experiment i have used multiple choice forms. I would like that the subjects are only able to advance to the next item whent hey have made a selection. How can i do that?
I hope you can help me.
Greetings
Felix

Comments

  • Hi Felix,

    You will need a bit of Python inline code to do this. The logic is explained in this post (my first comment in this discussion):

    Because the solution provided here was written for an older version of OpenSesame, I uploaded a new working example here:

    (Save with the extension .osexp and run as normally.

    I hope this helps.

    Best wishes,

    Lotje

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

  • Hi Lotje,
    can you tell me in which line of your second example are the part of the code i need?
    Best wishes
    Felix

  • edited January 2017

    Hi Felix,

    The part of code you'll need is the following. It should be put in the Prepare phase tab of an inline_script item that is placed after the form_multiple_choice item(s):

    while True:
        # Prepare and run the multiple choice forms (you'll have to adapt the names to your own experiment):
        items.prepare("form_multiple_choice")
        items.run("form_multiple_choice")
    
        # If no response is given, continue to show the form.
        # Otherwise, break from this while loop and advance to the next item
        if var.response != "no":
            break
    

    I attached an example experiment.

    Good luck and let us know if you have any further questions!

    Lotje

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

  • Hey Lotje, now i understand
    Thank you very much.

    Best wishes
    Felix

  • Hey Lotje,

    Thank for sharing your solution. I am fairly new to OP as well and have a similiar problem as Felix has/had.

    I tried out your script and it works great for form_multiple_choice, although I had to place it in the Run phase of the inline script because when I run the experiment and your code was placed in the Prepare phase, it skipped the forms before the first form_multiple_choice and started with the first form_multiple_choice. When placed in the Run phase, it works fine though.

    My actual questions is something diffrent...

    I tried to apply this script to form_base. I have a couple of them in my experiment and most of them include one or two rating scales and a "next" button to advance to the next form. The script works when pressing the button the first time but advances anyway when pressing the button a second time. Do have any idea how to fix this? Many thanks already!!!!

    Best,
    David

  • Sorry, I have to correct myself!

    When placed in the Run phase, two responses have to be given no matter what. So even if I respond correctly, I have to do it twice.

    David

  • Hi David,

    Would you mind sharing your experiment? Then, I could have a look.

    Besides, the newest version of Opensesame (3.2.1), has a new feature that is called form validation. With that you don't need to have this extra inline_script, but you can simply set what type of responses are required to proceed with the next item. If you upgrade, your life will probably be a little easier.

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.