In this article
Instead of specifying a certain Theme or Page Layout for an interview page, you can base the look and feel of that page on the respondent's answer to a previous question, or a background question, or a combination of these. As you can use the same technique on themes and page layouts, the question skin level and on the style level, this enables Authoring users to tailor the survey layout to each individual respondent.
Note: The Dynamic Survey Layout functionality is not supported in the CAPI/Kiosk console. Surveys that include dynamic layout can be run on a CAPI/Kiosk console, but without the dynamic functionality.
In this example, the Age and Gender questions have been placed within a Page object (go to Survey Objects for more information), which has been named "Age and Gender". We will use the Page Layout property of the “Age and Gender” Page object to display the Age and Gender questions slightly differently based on the respondent's region.
Figure 1 - Setting up a dynamic survey layout
Do this by calling a function from the Page Layout field of the Page object - . The carets (hats) tell Authoring that the text between them is not the name of a layout, but is coding that is to be interpreted. In the figure above, a function called “findPageLayout” is called, which will evaluate which Page Layout is to be used for this page.
Inside the “Dynamic layout settings (Script)” object (script can be placed anywhere in the tree), type the following code:
A function is a group of code lines that will execute each time the function is called. A function can perform checks or controls, and then set (normally hidden) questions based on the result. Alternatively, as in this case, the function can return the result of its evaluation to the place where the function call was made. In this example the function checks the current respondent's answer to the region question, returning Page Layout name “two questions diagonal” - if the respondent is from Europe. If the respondent comes from any other region, the Page Layout name “two questions” is returned - .
Figure 2 - The "two questions" page layout
The “two questions” page layout displays two questions next to each other. This will be the layout used for all respondents who have specified a region other than Europe.
Figure 3 - The "two questions diagonal" page layout
The “two questions diagonal” page layout displays the first of two questions in the upper left corner of the question area (question skin), and the second question (here Age) in the lower right corner. The logo will be displayed in the other two cells (see the figure above). This layout is then used for all respondents who have specified the region as Europe.
For a respondent who selects any region except Europe, the Gender and Age page is displayed - as below.
Figure 4 - Gender and Age for Non-Europeans
While respondents who select Europe as their region will see the Gender and Age page displayed - as below.
Figure 5 - Gender and Age for Europeans
The options and possibilities here are limitless. You can base the layout on the respondents’ answers to previous questions, and on their background and panel questions. Using scripting you can for example base the layout on time and date, or on pseudo-random selections.