Start a conversation

How can I limit the number of answer items that can be selected?

Overview

This article explains how to limit the number of answer items that can be selected in a survey question using the plausibility check feature.

Information

Let's assume that you want to create a question where the survey respondents are only allowed to select 3 out of 6 answer items. In order to check the number of selected items, you can use the plausibility check.

 

Step 1: Create a plausibility (standard check) check on the respective survey page

 

Step 2: In order to access the code editor, you have to first enter a random plausibility check definition, otherwise the code editor will not show up (weird I know).

 

Step 3: After you have clicked on save, the meta pro editor is visible.

Enter the following code into the editor:

if (( v_43 + v_44 + v_45 + v_46+v_47+v_48) != 3 ) print "Please select 3 items";

 

Note: You must adjust the variables according to your specific survey.

 

FAQ

How do I adjust the variables in the code?

The variables (v_43, v_44, etc.) in the code represent the answer options in your survey. Replace these with the actual variable names or numbers corresponding to your survey's answer options.

Can I change the limit to a different number?

Yes, you can change the number in the code from 3 to any other number to set a different limit on selectable items. For example, to limit to 4 items, change the code to: if (( v_43 + v_44 + v_45 + v_46+v_47+v_48) != 4 ) print "Please select 4 items";

 

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments