Forms, widget buttons and if-then's
Hello,
I am quite new to Open Sesame and have very limited Python knowledge so any help would be greatly appreciated.
I have a loop in which there are several forms with a picture and 2 button text widgets. Let's say that below the picture one button says "YES" and the other "NO". The participants should be able to move to the next picture only if they click YES (this happens naturally). But if they click NO they should not be able to see the next picture (new form) but go onto the next loop (questionnaire). Is this possible? #desperate
Thank you
Here is an example of the picture with the 2 buttons. (PS YES/NO are not the actual responses but I put them here to simplify)
If they respond "NO" on the Tracing_1F they should go directly to Fatigue scale, and not tracing_2F
Comments
Hi @ksalluzzo ,
Yes, that's certainly possible. The trick is to link both buttons to experimental variables, say
button_noandbutton_yes, using thevarkeyword when defining thebuttonwidgets. Next, you can use a run-if statement in thesequenceto determine which items should be executed under which conditions, i.e. when which button is clicked. For example, to run an item only when the Yes button was clicked, and assuming you've linked the Yes button to the variablebutton_yes, you could use the run-if statement[button_yes] = yes.I hope this conveys the general point. You can find more details on the documentation site:
Hope this helps!
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hello Sebastiaan,
I finally got it after a lot of playing around!
Thank you so so much :)