[Skip Global Navigation]

SPSS Tech Tips

SPSS Direct Home

Creating Questionnaire Wizards for Dimensions™ Desktop Author™ 5.0

This is a complimentary tip available to SPSS Direct subscribers.

Question

The latest version of Desktop Author includes Questionnaire Wizards to simplify the creation of new questionnaires. How can I create a custom Questionnaire Wizard?

Answer

While Desktop Author 5.0 ships with a variety of wizards, you may find it useful to create your own by using mrStudio™. You can use these wizards to automate the creation of commonly used questions or even entire surveys. To create a custom wizard, follow the process below or view this demonstration.

Questionnaire Wizards work through the interaction of three metadata document (.mdd) files: the Source .mdd, the Wizard .mdd, and the Target .mdd.

The Source .mdd contains the basic structure of the question or questions that you will insert. It uses the WizardPath HDATA property to point to the Wizard .mdd:

HDATA -

[

WizardPath = ".\QWzd\MyWizard.mdd"

];

The Wizard .mdd prompts you for information when you attempt to insert the Questionnaire Wizard in Desktop Author 5.0. For example, the metadata might contain a variable with a label such as "Please enter the product name." You would use this product name as the topic of the questionnaire generated by the Wizard.

The routing for the Wizard .mdd should contain the Source .mdd's metadata and routing script and also perform text replacements and apply the changed script back to the source:

Routing(QWzd)

ProductName.Response.Initial = ExampleProductName.Label

IOM.Banners.AddNew("Description", WzdBanner.Label)

ProductName.Ask()

' Get both metadata and routing from the source script

Dim source_script

source_script = source_mdm.Script

' Perform the text replacement

source_script = Replace(source_script, "__productname__", ProductName.Response)

' Apply the changed script back to the source

source_mdm.Script = source_script

Sub AddResponses(mdm, responses, elements)

Dim elem, cats, cat_name, cat_label

cats = Split(responses, mr.Lf)

For Each cat_label in cats

If (cat_label <> "") Then

cat_name = mdm.MakeName(cat_label)

Set elem = mdm.CreateElement(cat_name, cat_label)

elem.Type = 0

elements.Add(elem)

End If

Next

End Sub

End Routing

Once you enter the required information, the Wizard .mdd will modify an in-memory version of the Source. mdd, which is then inserted into the Target .mdd (the .mdd file currently open in Desktop Author).

Be sure to save the Source and Wizard .mdds in Desktop Author’s repository or questionnaire library so that other users may access the files.

If you would like more information on creating Questionnaire Wizards for Desktop Author 5.0, you’ll find a full example—including scripts—in the Dimensions Development Library™ under "Creating Questionnaire Wizards for Desktop Author 5.0."