Rank Order Grid questions require to have the same number of rows and columns. However, you may wish respondents to select their top three selections from among a group of more than three options. The instructions below demonstrate the use of scripting to hide unnecessary columns.
This script will ensure that the extra columns are not displayed but they must be added in or the study will not pass validation.
Detailed Steps
Set Rank Order Grid question properties
- Click on the Questionnaire tab of your study.
- Click on the Rank Order Grid Question in your Questionnaire Tree.
- Click on the Properties tab.
- Deselect the Question Completion Required checkbox.
- Enter the number of items that you wish to rank in the Required Row Count field.
- Click Save.
Prepare the script in Notepad
- Open Notepad or a similar text editing tool.
- Copy the script below into Notepad.
- Edit the script in Notepad as follows:
- Replace RANK_ORDER_GRID with the question name of the Rank Order Grid question.
- Replace TOTAL_RANK with the total number of items you wish to rank.
Note: Type in an integer. Do not spell out the number.
- Save the completed script in Notepad.
Note: 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 study.
/* Script Name: How do I hide rank order grid columns? 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. */ ShowColumns(RANK_ORDER_GRID, GetIntArrayBetween(1, TOTAL_RANK)); int j = TOTAL_RANK; foreach (ShowQuestionAction sqa in RANK_ORDER_GRID.WorkflowSteps) { ChoiceQuestion cq = (ChoiceQuestion)sqa.ChoiceQuestion; for (int i = (j+1); i <= cq.Answers.Count; i++) {Hide(cq,i);} }
Insert the Script
- Right-click on the Rank Order Grid question.
- Select Edit Scripts... from the menu.
- Copy the completed script from Notepad into the On Load section of the Rank Order Grid question.
- Click Save.
- Click Validate.
More Information
Read this WebHelp article to learn more about Rank Order Grid questions.
Comments
0 comments
Article is closed for comments.