Professional > Interview scripting > Writing interview scripts > More than one question per page > Changing the order in which questions are asked
 
Changing the order in which questions are asked
The interviewing program normally asks questions in a page, block, or compound item in the order they are defined in the metadata section. You can choose a different order by using IQuestion.QuestionOrder in the routing section.
Syntax
Qname.QuestionOrder = OrderConstants.order
Parameter
order is one of:
oRandomize
Display questions in a random order.
oReverse
Reverse the display order between respondents; that is, display Q1 to Qn for respondent 1 then Qn to Q1 for respondent 2, and so on.
oRotate
Display questions in rotation so that each question takes a turn at being first in the display.
Example
Suppose you have a page that displays three questions about the cleanliness of trains and stations, and you want to rotate the question order between respondents. Here's how you'd do it. In the metadata section, define the questions as normal:
Agreement define {
CompAgree "Agree completely",
PartAgree "Agree somewhat",
NeitherAgree "Neither agree nor disagree",
PartDisagree "Disagree somewhat",
CompDisagree "Disagree completely"
};
Intro "How much do you agree/disagree with the following statements?" info;
ValueMe "The company values my work." categorical[1..1]
{use Agreement};
Targets "I have clear targets/objectives." categorical[1..1]
{use Agreement};
Required "I understand what is required of me." categorical[1..1]
{use Agreement};
RatingPage page(ValueMe, Targets, Required);
Then, in the routing section, type:
RatingPage.Banners.Add("RatingPageBanner", Intro.Label)
RatingPage.QuestionOrder = OrderConstants.oRotate
RatingPage.Ask()
The first interview will display ValueMe, Targets, and Required; the second will display Targets, Required, and ValueMe; the third will display Required, ValueMe, and Targets, and so on.
Nested question groups
Block questions can be nested: that is, a block can contain other blocks. When you define ordering for a block that contains other blocks, the ordering applies only to the block named on the ordering statement; it does not apply to blocks nested within that block. If you want to reorder the questions within a block you must write a separate statement to do this.
Example
Suppose that you have two sets of questions to ask about train travel. You want to ask the questions in each set in a random order, but you also want to present the two sets in rotation. This is where you use block rather than page because it allows you to define the two sets of questions as components of a parent question, and to specify the order in which the questions and subquestions are presented.
The questions are defined in the metadata section as follows:
Agreement define {
CompAgree "Agree completely",
PartAgree "Agree somewhat",
NeitherAgree "Neither agree nor disagree",
PartDisagree "Disagree somewhat",
CompDisagree "Disagree completely"
};
Intro "How much do you agree/disagree with the following statements?" info;
RatingBlock "How much do you agree/disagree with the following
statements?" block fields
(
Payment block fields
(
Salary "The company pays good salaries." categorical[1..1]
{use Agreement};
Holidays "I get enough holiday for my needs." categorical[1..1]
{use Agreement};
Benefits "The company provides good benefits." categorical[1..1]
{use Agreement};
);
Training block fields
(
EnoughTrg "I get enough training for my job." categorical[1..1]
{use Agreement};
RightTrg "I get the right training for my job." categorical[1..1]
{use Agreement};
);
);
This shows quite clearly that Payment and Training are both subsets of RatingBlock. You want to present the questions within these blocks in a random order, and to rotate the blocks themselves, so the routing instructions are:
RatingBlock.Payment.QuestionOrder = OrderConstants.oRandomize
RatingBlock.Training.QuestionOrder = OrderConstants.oRandomize
RatingBlock.QuestionOrder = OrderConstants.oRotate
RatingBlock.Ask()
This code displays all the questions on one page. If you want to display each question on a separate page, use RatingBlock[..].Ask() instead.
Ordering when questions are re-asked
If questions are re-asked, the interviewing program uses the same ordering each time the questions are asked. The only time this changes is if the script defines a different order property for the replay.
See also
More than one question per page