Tip: Are you trying to pipe/hide/mask answer options from one question to another question? You can now do this in surveys with no need for scripting or templates. For more information, see Carry Forward Answers in the Surveys documentation.
This template is used when you want to mask into a Rank Order question on both desktop and mobile. In the template there is a page with two questions in it, a Rank Order Sort that is seen in desktop view and a Multi Choice Grid which is seen in mobile. The script on the Multi Choice Grid will prevent participants from selecting the same rank for multiple items. Any data answered in the mobile question is automatically populated back into the desktop question for consistency. The script will also auto-punch if only one option is to be shown.
The question which you would like to reference will be referred to as previous question. The question that will be masked will be referred to as masking question.
Notes:
- A limit of 20 items can be masked.
- Please be aware that when masking a rank order question, the "Total Participant" count in Analyze will match the number of members that were able to rank the first answer option programmed in the questionnaire. For reporting purposes, to find the base size for the number of unique members that provided an answer, switch to the table view and observe the "Total" row.
Tip: Did you know you can mask answers into a Rank Order question in surveys without having to use scripting? For more information, see Mask answers in a question.
Example
You have a Multi Choice question with 7 options and are asking participants to select the ones they like. Then in a followup ranking question, you ask them to rank (to a maximum of 3) their choices.
Desktop Example
Mobile Example
Detailed Steps
- Import the template study into your community.
Download the XML template, found here.
- Prepare your questions.
- Author the previous question.
- Do not move the questions around in the RKM_RANK_PG page or add new questions to the page.
- Ensure that the list of items at the masking questions is the same as the options in the previous question.
- Enter the number of ranks:
- To allow respondents to rank all the selected items (For example: if they select 7 options, they will rank all 7):
- Go into the properties section of the Rank Order Sort and set the Number of ranks property to the number of options you have.
- Go into the Multi Choice Grid, delete columns until you have the same number of columns as options and set the Required row count property to the number of options you have.
- To allow respondents to rank up to a maximum number (For example: Even if they select 7 options, you want them to rank 3 items only):
- In the properties section of the Rank Order Sort, set the Number of ranks property to the maximum you want to enforce.
- In the Multi Choice Grid, delete columns until you have the same number of columns as the maximum number of ranks, and set the Required row count property to the maximum number of ranks.
- To allow respondents to rank all the selected items (For example: if they select 7 options, they will rank all 7):
- (Optional) Rename the page and/or questions in the page if needed.
If you intend to perform this, you must also update the scripts on the RKM_RANK_PG page.
- Update the blue text in the following line to the name of the Rank Order Sort question, note that this line is only in the OnLoad and OnExit scripts
GridSequence desktop = RKM_RANK; - Update the blue text in the following line to the name of the mutlichoice grid in the page, note that this line is in the OnLoad, OnValidate and OnExit scripts:
GridSequence mobile = RKM_RANK_MOBILE;
- Update the blue text in the following line to the name of the Rank Order Sort question, note that this line is only in the OnLoad and OnExit scripts
- Adjust scripts in the RKM_RANK_PG page:
- In the OnLoad script of the page, update the line that starts with int[] sourceIndexes
Case Example Multi Choice (either button or choice question):
Change Q_PREVIOUS to the name of your previous question./* Script Name: How do I pipe / hide / mask options from a Multi Choice question into a Rank Order question for desktop and mobile? (Power Surveys) 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. */ int[] sourceIndexes = GetSelectedIndexes( Q_PREVIOUS );
- In the OnLoad script of the page, update the line that starts with int[] sourceIndexes
- Validate and test.
More information
Please click on the webhelp links below for more information:
Comments
0 comments
Article is closed for comments.