+xHi, I want to ask a question and determine if people can continue with the experiment based on their answer. I added an example above (not exactly the question I will use, but you get the idea). If people click "yes" the experiment should just continue, but if they click "no" or "who" participants should be sent to the postinstructions or kicked out of the experiment. I know I need an if statement for this (in the trial specification? block specification?) something like if trial.mytrial.response == "yes" continue else abort, but I don't know how to put this exactly.
<trial mytrial>
/ stimulusframes = [1=question, yes, no, who]
/ inputdevice = mouse
/ validresponse = ("yes", "no", "who")
</trial>
<text question>
/items = ("Do you agree that Dave is a pretty cool guy?")
</text>
<text yes>
/ items = ("Yes")
/ txbgcolor = grey)
/ position = (40%, 60%)
/ vjustify = center
</text>
<text no>
/ items = ("No")
/ txbgcolor = grey)
/ position = (50%, 60%)
/ vjustify = center
</text>
<text who>
/ items = ("Who is Dave?")
/ txbgcolor = grey)
/ position = (60%, 60%)
/ vjustify = center
</text>
<block ThanksDave>
/ trials = [1= mytrial]
</block>
Thanks for that example -- that made me laugh... :)
Best route to go here, IMO, would be using a /skip condition in the "actual" task <block>s following the block with the screening question / trial. /skip those if the response to the screening trial was not "yes". Concretely:
<trial mytrial>
/ stimulusframes = [1=question, yes, no, who]
/ inputdevice = mouse
/ validresponse = ("yes", "no", "who")
</trial>
<text question>
/items = ("Do you agree that Dave is a pretty cool guy?")
</text>
<text yes>
/ items = ("Yes")
/ txbgcolor = grey)
/ position = (40%, 60%)
/ vjustify = center
</text>
<text no>
/ items = ("No")
/ txbgcolor = grey)
/ position = (50%, 60%)
/ vjustify = center
</text>
<text who>
/ items = ("Who is Dave?")
/ txbgcolor = grey)
/ position = (60%, 60%)
/ vjustify = center
</text>
<block ThanksDave>
/ trials = [1= mytrial]
</block>
<trial tasktrial>
/ stimulusframes = [1=tasktext]
/ validresponse = (57)
</trial>
<text tasktext>
/ items = ("If you read this, you answered 'yes'.")
</text>
<block taskblock>
/ skip = [trial.mytrial.response != "yes"]/ trials = [1=tasktrial]
</block>
<page theend>
^This is the end.
</page>
<expt>
/ postinstructions = (theend)
/ blocks = [1=thanksdave;
2=taskblock]
</expt>
Hope this helps!