Ranking Question
A Ranking survey question, or a rank order question, is a type of survey or research question that is used to determine people's opinions, attitudes, and priorities towards several characteristics of a certain subject or towards multiple related options. This question asks respondents to arrange a set of choices in order of preference, importance, or other criteria, or assign a numerical value to each choice based on their relative rank. For example, a survey ranking question might ask respondents to rank a set of job benefits in order of importance, or assign the highest value to the most important job benefit, and the lowest value to the least important one. This way an employer can get a solid understanding of overall ranking of several job benefits they are considering to offer, identify which of them employees prefer or value most, and act accordingly.
Create a Ranking Question
To add a Ranking question to a form, define an object with the type
property set to "ranking"
and add it to the elements
array. Use the choices
array to configure ranking items. Each object in this array should have the following structure:
{
"value": any, // A unique value to be saved in the survey results.
"text": String // A display text. When `text` is undefined, `value` is used as display text.
}
If you need to specify only the value
property, you can set the choices
property to an array of primitive values as shown in this demo. These values are both saved in survey results and used as display text.
You can also load choice values from a RESTful service. In this case, use the choicesByUrl
property instead of the choices
array. Refer to the ChoicesRestful object for information on how to configure this property. The demo on this page defines local choices
.
Set the Initial Sort Order
Ranking items are sorted according to the choices
array. If you want to sort them in ascending or descending alphabetical order, assign "asc"
or "desc"
to the choicesOrder
property. Alternatively, you can set this property to "random"
. In this case, choices appear in random order each time your survey is displayed.
Drag a Ranking Item by the Icon
The entire ranking item area responds to drag gestures. If you want to limit the area and use only the drag icon as a drag handle, assign "icon"
to the settings.rankingDragHandleArea
property. This setting affects all Ranking questions in your application.
Carry Forward Responses
You can use the Ranking question to implement the Carry Forward Responses feature. This feature allows you to copy choices from one question to another. For example, you can ask respondents to select choices in a Checkboxes question and then rank the selected choices in a Ranking question. Refer to the following demo for more information: Carry Forward Responses.