Skip to main content

Kinesis Support

All the topics, resources needed for Kinesis.


FocusVision Knowledge Base

Random Sequencer

Randomizations and rotations of all levels of complexity can be incorporated into survey design with Kinesis. This includes randomizations and rotations to answer choices, questions themselves, sets or batteries of questions (question groups), groups of groups, table rows and/or table columns, media insertions, and virtually any survey element.

1:  How to Use the Random Sequencer

There are often special cases for randomizations in which the same random sequence is desired in multiple locations throughout a survey. Consider the following question set:

Which deli meats do you eat on a regular basis? [RANDOMIZE]

Roast beef
Other, please specify:
None of the above

A subsequent question might read:


Roast beef
Other, please specify:
None of the above

The Random Sequencer can be used here to carry the rotation across multiple questions. It does this by creating a numeric rotation seed that can be reused across all questions, tables, and groups. This sequence can also be stored to data for later analysis.

The Random Sequencer will support/maintain the same sequence even if the number of elements is different from one question to another (for instance, if the first question has five elements and the second question has four elements). However, for this to occur, the sequence must be programmed to the maximum number of options utilized in any one question. That is, a question of five elements will not maintain the same order if the sequencer is only programmed for four question elements, but a four-option question will maintain the proper order if the random sequencer supports five question elements (as an example).Question options also may be anchored with the Random Sequencer. Multiple Random Sequencers may be used within the same study.

To begin, select the Random sequencer from the Survey functions menu and select ‘Add new random sequence at the top of the screen:

Enter the maximum number of elements that will possibly be included in your sequence:

Give the sequence a name if desired, and document any further information that may be necessary for others. Runtime is generally set to ‘No’ unless the random sequence is based upon a computational or other conditional logic, in which case the random sequence is determined at the time the survey is actually taken by the respondent (runtime). For instance, sequences can be programmed based upon ranking orders, to always display specific items together, and in many other complex scenarios. For these types of situations, further computational logic will be required. 

Next, select ‘Setup Anchors & Links to establish any elements that should be anchored (i.e, not randomized or rotated) and/or linked together (displayed together).

Once the sequencer has been programmed, it will be available in table conditional logic, groups, and elsewhere to apply against specific randomization logic throughout the survey.

1.1:  Applying a Random Sequence to a question or matrix

For a standard question you can apply your Random sequence in the "Advanced properties" tab by selecting it from the pulldown shown below.

For a matrix you can apply your Random sequence by clicking on the "Edit table logic". Once there, you will need to go to the "Row logic" tab where you can select your random sequence from the pulldown shown below.

2:  Randomize/Rotate Within a Question

To randomize or rotate options within a question, open up that question in the Survey Editor, or, while programming it, check those items that you wish to randomize under the Rand column. The other items will be anchored in their existing position. Select the desired randomization mode from the pulldown menu at the bottom of the screen. For all screens:

  • Randomize will perform a purely randomized display of selected elements.
  • Random rotate will randomly select the first item, then rotate display from there (while still anchoring the display of unchecked items).
  • Random rotate reverse will randomly select the first item, then display the list in reverse order (while still anchoring the display of unchecked items).
  • Sort alphabetically will display in alphabetical order, while anchoring unchecked items.

2.1:  Randomize a Set of Questions

To randomize a set of questions, program the questions, check the first question and last question that are in the set to be randomized, and hit the ‘Group Selected Range’ button at the side of the page. Once the group has been created, the following screen will appear:

The group may be given a name if desired, and if only specific people are to see it, logic programmed. It is not necessary to put logic on a group. Simply check those questions for which randomization is desired, select the desired randomization mode, and indicate whether or not you wish to force a page break after the group of questions has been presented so that it is not presented on the same page as any other question.

You can also have this randomized grouping fall into a specific randomization sequence if desired. More will be written about random sequences later in this section.

2.2.:  Randomize Table Rows / Columns

To randomize table rows or columns, click on the Condition Editor and use the tabs at the top of the screen for tables and check which rows or columns you want randomized, leaving those that you want anchored unchecked.

3:  set_random_sequence

Set any existing sequence to a certain order. This function can be used to alter random sequences, for example, based on what a respondent answered.

In most cases you will need to set this at the beginning of the survey. Create a Computational question as your first question and insert the following code:

# Create sequence array that matches the number of elements used in the sequence

# Override sequence ID 1 with the created sequence
Random sequence must be created by using random sequencer first. Each random sequence will initialize to random order when a new survey session is started. After this point, set_random_sequence function can be used to override the existing sequence. Sequence ID can be obtained from random sequencer main page that lists the created sequences.
Random sequences can be set in any condition being evaluated. Typically one would call this function from hidden computational value or default answer value condition.

3.1:  set_random_sequence example application

One application of the set_random_sequence function is presenting a set of questions which:

  • follow the ranking sequence of a previous ranking question;
  • are a subset of all the ranked options

This example shows a ranking question with ten options that is followed by six questions, out of a total of ten, that follow the previous ranked order.


These are the necessary steps for the setup:

  • Set the ranking question itself - in this example Qrot with 10 choices
  • Set the questions that need to follow the ranking sequence - they need to match the no. of choices of the ranking question. In this example questions QR1, QR2, ..., QR10
  • Create a random sequence with 10 items, in this case called "New Random Sequence", setting "Set random sequence runtime" to yes

  • Group questions QR1, QR2, ..., QR10, setting "Follow randomization sequence from?" to match "New Random Sequence".

  • Create a container for the first six choices, in this case checkbox question Qfirstsix; this checkbox will contain the first six ranked options at Qrank, which can be stored using the following default answer condition
$USER_temp_array = $Qrank;
return array_slice($USER_temp_array, 0, 6); 
  • add a condition for each of the QR1, QR2, ..., QR10 series, like so:
# at QR1
# at QR2
# at QR3
# at QR4
# at QR5
# at QR6
# at QR7
# at QR8
# at QR9
# at QR10
  • create a computational that executes the function set_random_sequence. The code below sets the random sequence of ID 2

to use the sequence created by Qrank; the statement "return 1;" is not strictly necessary, but computational questions expect a value to be returned.

$USER_sequence = $Qrank;
return 1;
  • below a screenshot of all the questions:

3.2:  set_random_sequence with linked randomized groups

$USER_a = array(1,4,5,6);
$USER_b = array(2,3);
$USER_c = array(7,8);


$USER_pos = rand(0,4);

array_splice($USER_a, $USER_pos, 0, $USER_b);
array_splice($USER_a, $USER_pos, 0, $USER_c);


The above code is an example of an 8 option random sequence with 2 linked groups (options 2 and 3 / options 7 and 8). The code takes the options and shuffles them while maintaining the linked groups. Then, it inserts the randomized linked groups into the sequence randomly.

  • Was this article helpful?