Millisecond Forums

valid response in checkbox

https://forums.millisecond.com/Topic19848.aspx

By Andraster - 10/12/2016

Hey guys,
I am trying to create a simple checkbox survey. I can't figure out how to define the valid and correct responses though. No matter ho i define them, as soon as I define any validresponse at all, I can't click the "Next" Button when I run the experiment because the answer is not considered valid. It would be great if someone could help me with this, thank you.

<survey survey>
/ pages = [1 = p1]
</survey>

<surveypage p1>
/ questions = [1 = q1]
</surveypage>

<checkboxes q1>
/ options = ("Answer 1", "Answer 2", "Answer 3")
/ optionvalues = ("1", "2", "3")
/ validresponse = ("1", "2", "3")
</checkboxes>


By Dave - 10/12/2016

You usually don't have to define /validresponse for checkboxes at all (i.e., you can simply remove the /validresponse attribute). Since <checkboxex> allow for multiple simultaneous answers (i.e., you can check one option, two, or all three), you would only be able to move on with all three checked here when /validresponse is defined.

Assuming you want to restrict responses such that a participant has to select one option -- and only one -- you do that via the /range attribute:

<survey survey>
/ pages = [1 = p1]
</survey>

<surveypage p1>
/ questions = [1 = q1]
</surveypage>

<checkboxes q1>
/ caption = "Check one option (and one only):"
/ options = ("Answer 1", "Answer 2", "Answer 3")
/ optionvalues = ("1", "2", "3")
/ range = (1,1)
</checkboxes>

Hope this helps.
By Andraster - 10/13/2016

Great, this helps a lot. Thank you!