Tip: You can do this in modern surveys and the script is now available! For more information, see How do I add an exclusive check box on a page with an Open End question? (Modern Surveys).
This script allows the participant to opt out of an Open End question by providing a check box indicating that they do not have an answer or prefer not to provide an answer to the question.
Detailed Steps
- Click the Questionnaire tab of your survey.
- Create a Page.
- Create an Open End question within the Page.
- Deselect Question completion required in the properties of the Open End question.
- Create a Multi Choice question within the page
- Add the opt-out text as an answer option, such as "Don't Know" or "Refuse to Answer" and click OK
- Deselect Question completion required in the properties of the multi choice question and delete the default instruction text from the question.
- Copy the script below into Notepad or any other text editor (e.g. Notepad++, Textpad).
- Replace VQ_Name with the question name of the Open End question.
- Replace DK_Name with the question name of the Multi Choice question.
- Insert the completed script into the Script section of the page by doing the following:
- Select the page in the Questionnaire Tree.
- In the Scripting section of the page, click Edit Scripts.
- Paste the script into the On Validate tab.
- Click Save.
- Validate and test your study.
Script
This script forces participants to either select the checkbox or enter an answer for the Open End Question.
/* Script Name: How do I add an exclusive check box on a page with an open end question? To ensure your script works as expected, always copy the original script from the script library found in the support portal. Failure to use the most up to date script from the script library may cause unexpected results. */ //Force respondents to either select the checkbox OR answer the Open End Question. VerbatimQuestion vq = VQ_NAME; ChoiceQuestion cq = DK_NAME; if ((vq.StringValue.Trim() == "") && (cq.SelectedAnswer == null)) { if (this.Culture == "en-CA"){NewError("Please enter in a response.");} else if (this.Culture == "fr-CA") {NewError("Veuillez répondre à cette question.");} return; } else if ((vq.StringValue.Trim() != "") && (cq.SelectedAnswer != null)) { if (this.Culture == "en-CA") {NewError("Please enter one response only.");} else if (this.Culture == "fr-CA") {NewError("Veuillez n'entrer qu'une seule réponse.");} return; }
Notes:
- The question names used in scripts are case-sensitive. Ensure that you use the exact question names as they appear in the Questionnaire tree of the survey.
- If the participants try to skip the questions or try to answer both questions, the Completed script will generate error messages in English US or French (depending on the Panelist's culture property) to prompt participants to answer one of the two questions.
- You can replace the script text Please complete the question with the appropriate error message that you want to display.
- If your community is not using English US or French, you can update the script with the language codes used in your community. Please see More Information section below to know the language code for each culture.
Comments
0 comments
Article is closed for comments.