Millisecond Forums

How to dynamically change if a question is required

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

By gaumarjos - 9/23/2015

Hi I want people to first be notified if they didn't answer a survey question and then be able to skip, in lines with ideas of informed consent and being able to skip questions. . However, it appears the status of /required does not update until after the whole trial (surveypage) has been submitted. Is there a workaround? 

I have tried a lot of options but the most obvious, which doesn't work is:

For instance this doesn't work

<surveypage cultural_religious>
/caption ="<%values.demographicpageinstructions%>"
/ fontstyle = ("Verdana", -14, false, true, false, false, 5, 0)
/ questions = [1=school; 2=govt; 3=religiosity]
/ itemspacing = 2%
/ showbackbutton = false
/ ontrialend = [radiobuttons.religiosity.required = false]
</surveypage>
And this works (changing it to not required at the beginning) but doesn't do what I want

<surveypage cultural_religious>
/ ontrialbegin = [radiobuttons.religiosity.required = false]
/caption ="<%values.demographicpageinstructions%>"
/ fontstyle = ("Verdana", -14, false, true, false, false, 5, 0)
/ questions = [1=school; 2=govt; 3=religiosity] 
/ itemspacing = 2%
/ showbackbutton = false
</surveypage>


By Dave - 9/23/2015

> However, it appears the status of /required does not update until after the whole trial (surveypage) has been submitted. Is there a > workaround?

/ontrialend is executed after the responses have been submitted. If you were to run the same page / question again, the required status would be false. It is not possible to change a question's required status *while* the page / trial is running.

There is no real workaround. A somewhat inelegant option would be to include an explicit "decline to answer" response option:

<survey mysurvey>
/ pages = [1=mypage]
</survey>

<surveypage mypage>
/ questions = [1=myrb]
</surveypage>

<radiobuttons myrb>
/ caption = "Pick one"
/ options = ("A", "B", "Decline to answer")
/ required = true
</radiobuttons>