Professional > Interview scripting > Writing interview scripts > More than one question per page > Question blocks
 
Question blocks
Use a question block to define a set of related questions that you want to keep together as a group. During interviews, all questions in the block are displayed on the same page in the order they appear in the block. Demographic questions are typically defined as blocks.
Defining a question block
Put the following statements in the metadata section of the interview script:
BlockName ["Text"] block fields
(
  Questions
);
Parameters
BlockName
The name of the question block.
Text
The text to display at the top of the block.
Questions
Questions defined in the usual way.
Example
AboutYou "" block fields
(
Age "How old are you?" long [18..99];
WorkStatus "Do you work ...?" categorical [1]
{
Fulltime "Full time",
Parttime "Part time"
};
Dept "Which department do you work for?" categorical [..1]
{
CustomerService "Customer Services",
Facilities "Facilities",
Finance "Finance",
HumanResources "Human Resources",
IT "IT",
Sales "Sales/Marketing"
};
);
Displaying the question block
To display the question block, type:
BlockName.Ask()
in the routing section, where BlockName is the name of the question block.
Example
AboutYou.Ask()
IOM.GlobalQuestions.Add(ChangeTemplate)
ChangeTemplate.Style.Orientation = Orientations.orRow
ChangeTemplate.Style.Rows = 2
produces the following output:
Questions in a block are automatically namespaced, which means that their full names include the name of the block. In the example, the questions are called AboutYou.Age, AboutYou.WorkStatus, and AboutYou.Dept.
See also
More than one question per page