[Skip Global Navigation]

Training

Training Home

SPSS Trainer Tip: : mrInterview™

Instructor profile

Name: Keith Krystek

About Keith: Before joining SPSS in May 2003, Keith worked with SPSS survey software as a market research and human resources consultant. He has a BA from Illinois Wesleyan University and an MBA from Thunderbird–Garvin School of International Management. In his spare time, Keith enjoys hiking, biking, and traveling with his family.

Using Question subtemplates

mrInterview uses HTML templates to lay out and format the questions that will be displayed to survey respondents. The central template, or Layout template, provides the main characteristics of the page, including where the questions are placed, where the logo appears, and what the background looks like.

In order to determine the structure of the questions, mrInterview automatically uses a default Question subtemplate, which is referenced by a tag placed within the Layout template. This tag specifies where questions should be inserted.

The Question subtemplate contains tags referencing the main parts of a question:

This is an example of a default Question subtemplate:

<mrSubTemplate>
  <table>
  <mrData QuestionElement='Banner' />
  <br />
  <mrData QuestionElement='Error' />
  <br />
  <mrData QuestionElement='Label' />
  <br />
  <mrData QuestionElement='Controls' />
  <br />
  </table>
</mrSubTemplate>

In the example above, the different parts of the question are stacked vertically and separated by HTML line break characters, so that they will be displayed on top of each other as shown in the examples below.

Figure 1: Questions are displayed with text boxes and error messages below the question text.

Subtemplates may be used to change the layout of these items. A common use is the creation of a “form” page for collecting address or demographic information. In this case, the question text, text box, and error message are placed horizontally in a row.

To produce this layout, create a new Question subtemplate with the parts of the question in a table next to each other in columns.

<mrSubTemplate>
  <table><tr>
  <td width="100">
  <mrData QuestionElement='Banner'>Banner</mrData>
  <mrData QuestionElement='Label'>Label</mrData>
  </td><td>
  <mrData QuestionElement='Controls'>Controls</mrData>
  </td><td>
  <mrData QuestionElement='Error'>Error</mrData>
  </td>
  </tr></table>
</mrSubTemplate>

Using this subtemplate will produce questions as shown below:

Figure 2: Questions are displayed with text boxes and error messages next to the question text.

Once a subtemplate is created, you can apply it in several ways.

In a layout template, you can add a reference to the new subtemplate within the mrPage tag, as shown below:

<mrPage IncludeElementIDs = "true" QuestionTemplate="SameLine_Question_KK.htm" GridTemplate="DefaultGridTemplate.xml"></mrPage>

The new subtemplate must be uploaded or included with a project’s other templates to be used.

In the Build feature, you may simply add an IOM Script (Advanced) item and then add the reference.

Figure 3: The Question subtemplate is referenced in an IOM Script (Advanced) item within “Build.”

This same reference is also used directly in the Routing section of an Interview Script in mrStudio or Scriptwriter’s Station.

IOM.LayoutTemplate=”People_Working_Blue_Layout.htm”
IOM.QuestionTemplate="SameLine_Question_KK.htm"

Summary

mrInterview Question subtemplates provide additional flexibility in displaying specific parts of questions for different purposes.

Flexibility can also be found in other subtemplates, such as the Navigation, Error, and Banner subtemplates. See the Dimensions Development Library (DDL) for more uses and examples of subtemplates.

We offer SPSS courses at locations around the world.
Find a course in the location nearest to you.