Millisecond Forums

Require correct response

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

By nashby - 2/26/2015

Hi again. I am trying to make a task where participants must distribute 16 points over 16 options such that they use all 16 points. They can do this by putting 8 on one option and 8 on another, or 16 on one, or 1 on each, etc...

Is there a way to sum the values of textboxes/dropdown to make sure the totals entered are valid before the participant cant move on?
By Dave - 2/26/2015

Yes. radiobuttons and dropdowns have response properties just like any other element. You can sum those up and perform checks using /ontrialend logic, branching, <expressions> or the like.

<block myblock>
/ trials = [1=mypage]
</block>

<surveypage mypage>
/ questions = [1=a; 2=b]
/ branch = [if (dropdown.a.response+dropdown.b.response!=4) surveypage.mypage]
</surveypage>

<dropdown a>
/ options = ("0", "1", "2", "3", "4")
</dropdown>

<dropdown b>
/ options = ("0", "1", "2", "3", "4")
</dropdown>