Rank-order questions🔗

ranking, sort, classify, preference, rating, top-down, importance, priority, comparative, order, ordered list, sorting, sequential order

Rank-order questions are used in those cases when you want the users of your program to reorder a set list of options. For example:

  • to express preference
  • to rearrange a list by the size of the items in it
  • any time you want the users choose the order in which the elements of a list are arranged.

In order to create a rank-order question, you need to indent *type:ranking under the *question and provide the list to rank:

*question: Rank these creatures from best to worst
	*type: ranking
	Tigers
	Bears
	Pigs
	Dragons

Users can reorder the list doing drag and drop. Alternatively, if they are not using a touch screen, they can select the position of any given answer from the dropdown list that is displayed:

Rank order questions (1)

Here is a more detailed example of how rank-order questions work:

*question: Enter the books that you read last month:
    *tip: Type one book per line
    *multiple
    *save: booksRead
    
*question: Order the books that you read by the time it took you to read them:
    *tip: The book that took the longest should be up top
    *answers: booksRead
    *save: orderedBooks
    *type: ranking

The first question asks users to type in a list of the books they read that month. Their answer is saved in the variable booksRead. Let's say that this is the user's response: ["A Room of One's Own", "Catch-22", "Demon Copperhead", "One Flew Over the Cuckoo's Nest"]

The second question is the rank-order one, where booksRead is displayed and the user has instructions to reorder them.

Rank order questions (2)

If they clicked Next after reordering them as shown, the value of orderedBooks would be ["Demon Copperhead", "One Flew Over the Cuckoo's Nest", "A Room of One's Own", "Catch-22"]

Note that, although both collections have the same elements, they are different because the elements are in different order.


Next: