Various Ways to Change the Answers Order in a Question

Overview

This article will show you how you can display answers in a different order than the original list order the answers are in the designer.

Display Answers in a sorted order:

You can choose to display the answers in alphabetic order of the answers texts, using a function called SortAnswers(inQuesIdx):

I have a question containing these answers:

answers_order.jpg

To display these answers in an alphabetic order, write this function in the question's Start Script:

sort_rule.jpg

When running the survey, the answers in this question will be displayed like this:

alphabetic.jpg

If you want to display the answers in descending order, add "true" as a second parameter to the function, like this:

desc_true.jpg

Randomize answers order

You can display the answers in some undetermined randomized order. You can achieve this in two ways:

1. Go to the question's Advanced tab and enable the "Randomized answers/topics order" check box:

randomized_check_box.jpg

2. Use the RandomizeAnswers(inQuesIdx) function in the question's Start Script:

randomiz_func.jpg

Randomize answers order according to a pre-defined array 

You can set the displayed answers order according to array containing all possible answers indexes in a certain order.

For example, let's go back to this question, that contain these 6 answers:

answers_order.jpg

We want to the answers to be displayed in this order (the numbers represent the answers indexes): 4, 6, 1, 2, 5, 3

We can create an array containing these indexes in this specific order, and use that array to randomize the answers, like this code in the question's Start Script:

array_code.jpg

And so, the answers will be displayed according to the indexes order in the array, like this:

array_display.jpg

A more detailed description on setting the order of Answers in a given order can be found in the following short guide: How To randomize answers in a given order  

 

Visit us at: 

http://www.dooblo.net

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.