Professional Documents
Culture Documents
TOC Survey Programming Fundamentals
TOC Survey Programming Fundamentals
SurveyProgramming
Fundamentals
SurveyProgrammingFundamentals
Copyright2007byVergeConsulting,Inc.
Allrightsreserved.Nopartofthisworkmaybereproducedortransmittedinanyformormyany
means,electronicormechanical,includingphotocopying,recording,orbyanyinformationstorageor
retrievalsystem,withoutpriorwrittenpermissionofVergeConsulting.
Trademarkednamesmayappearinthisbook.Ratherthanuseatrademarksymbolwithevery
occurrenceofatrademarkname,weusethenamesonlyinaneditorialfashionandtothebenefitof
thetrademarkowner,withnointentionofinfringementofthetrademark.
ForadditionalinformationpleasecontactVergeConsultingdirectlyat4146SherelLane,Cincinnati,OH
45209.Phone5132823762,fax8668229333orvisithttp://www.VergeConsulting.com.
Theinformationinthisbookisdistributedonanasisbasis,withoutwarranty.Althoughevery
precautionhasbeentakeninthepreparationofthiswork,neithertheauthor(s)norVergeConsulting
shallhaveanyliabilitytoanypersonorentitywithrespecttoanylossordamagecausedorallegedto
becauseddirectlyorindirectlybytheinformationcontainedinthiswork.
Version:
SPF12(Dimensions4.5)
SurveyProgrammingFundamentals
TableofContents
TableofContents
Chapter1 IntroductiontoSurveyProgramming.....................................................................................1
TheBigPicture........................................................................................................................................1
WhatisSurveyDesignAbout?............................................................................................................2
TheSurveyProcess.................................................................................................................................2
DimensionsScriptingOverview..............................................................................................................2
InterviewObjectModel..........................................................................................................................2
ObjectOrientedProgramming...............................................................................................................3
WhatisObjectOrientedProgramming?............................................................................................3
DimensionsDevelopmentLibraryOverview..........................................................................................3
NavigatingtheDDL.............................................................................................................................4
Examples.............................................................................................................................................4
DDLLinks.............................................................................................................................................5
WhatismrStudio?..................................................................................................................................6
WhatsNext?...........................................................................................................................................7
Chapter2 ConstructingQuestions...........................................................................................................9
MetadataItemsFormat..........................................................................................................................9
InformationItems.................................................................................................................................10
NumericQuestions...............................................................................................................................11
Minimum........................(72J/)u...Dd0
..............................................j/TT0
1Tf0.0023
1Tf0.001
Tc4
- 0.053
Tc0Tc
1
- .863
<0............
Td(DDL)Tj/C2_01Tf05Tc3.470Td<00MaximTj/
0.001Tc3
-
TableofContents
SurveyProgrammingFundamentals
TipsforCreatingMetadata...................................................................................................................25
ViewingandTestingtheSurveyinmrStudio........................................................................................26
Exercise.................................................................................................................................................28
Chapter4 SpecialResponsesandOptions............................................................................................31
SingleResponseChoicesinMultipleSelectionQuestions...................................................................31
SpecialResponseswithCategoricalQuestions.....................................................................................34
CategoricalResponseswithNonCategoricalQuestions......................................................................36
CollectingOtherTextResponsesinCategoricalQuestions..................................................................38
Subheading...........................................................................................................................................39
Exercise.................................................................................................................................................42
Chapter5 BasicRoutingLogic................................................................................................................45
AskingQuestions...................................................................................................................................47
ReadOnlyItems....................................................................................................................................49
ConditionalStatements........................................................................................................................50
IfThenElse..................................................................................................................................50
SelectCase............................................................................................................................................52
Goto......................................................................................................................................................55
LogicalExpressions...............................................................................................................................56
NumericQuestions...........................................................................................................................56
BooleanQuestions............................................................................................................................57
TextQuestions..................................................................................................................................57
CategoricalQuestions.......................................................................................................................58
LogicalOperators..............................................................................................................................60
TipsforRoutingSectionSyntax............................................................................................................62
AddingErrorHandling...........................................................................................................................63
Exercise.................................................................................................................................................64
Chapter6 SharedLists...........................................................................................................................67
CreatingSubheadingswithSharedLists...............................................................................................69
Chapter7 SortingCategoricalResponseLists.......................................................................................73
SortinginMetadata..............................................................................................................................74
RoutingSectionSorting........................................................................................................................75
NotSortingSpecificResponses.............................................................................................................75
II
SurveyProgrammingFundamentals
TableofContents
KeepingSpecificCategoriesGroupedTogether...................................................................................77
Exercise.................................................................................................................................................78
Chapter8 RestrictingResponses...........................................................................................................79
FilterCategories....................................................................................................................................79
Limiting
III
TableofContents
SurveyProgrammingFundamentals
Loops/GridsFilteredonaSublistofCategories..................................................................................131
Exercise...............................................................................................................................................134
Chapter13
ControllingtheLookofYourSurvey...............................................................................137
OverviewoftheFormattingofaSurvey.............................................................................................137
Templates...........................................................................................................................................137
ApplyingaTemplatewithinYourScript.........................................................................................139
Folders............................................................................................................................................140
TipsforScriptwritersRegardingTemplates....................................................................................141
Styles...................................................................................................................................................141
DefaultStyles......................................................................................................................................141
Default............................................................................................................................................142
Categories.......................................................................................................................................143
Grid.................................................................................................................................................144
Labels..............................................................................................................................................146
Navigation.......................................................................................................................................146
Questions........................................................................................................................................147
QuestionStyles...................................................................................................................................148
CategoricalQuestions.....................................................................................................................148
TextQuestions................................................................................................................................149
MetadataStyles..................................................................................................................................150
CustomControls.................................................................................................................................151
XHTMLinLabels..................................................................................................................................151
WhatisXHTML?..............................................................................................................................151
FinalThoughtsonFormatting.............................................................................................................152
Exercise...............................................................................................................................................153
Chapter14
TextSubstitutionsandTextHeadings.............................................................................155
DisplayingResponsestoPreviousQuestions.....................................................................................155
InsertTextintotheMetadatathatwillbecontrolledintheroutingsection.....................................158
TextHeadings......................................................................................................................................162
Chapter15
EnhancingSurveyFlow...................................................................................................165
MustAnswer.......................................................................................................................................166
DefaultAnswers..................................................................................................................................166
IV
SurveyProgrammingFundamentals
TableofContents
Hiddendefaultresponses...............................................................................................................169
InitialResponse...................................................................................................................................170
Exercise...............................................................................................................................................172
Chapter16
CustomizingtheStandardErrorMessages.....................................................................173
Globalchangestoerrormessages......................................................................................................175
Errormessageschangesforaspecificmetadatafile..........................................................................175
Errormessageschangesforaspecificquestion.................................................................................176
Customizingtheerrormessage..........................................................................................................177
Chapter17
Functions&Subroutines.................................................................................................179
DefinitionofFunctionsandSubroutines............................................................................................179
Subroutine......................................................................................................................................180
SubroutineExample............................................................................................................................180
Function..........................................................................................................................................184
Exercise...............................................................................................................................................188
Chapter18
Validation........................................................................................................................189
ValidatingTextQuestionPatterns......................................................................................................189
CheckingCustomLogic.......................................................................................................................192
Addingcustomerrors.........................................................................................................................193
Addingcustompropertiestometadata.........................................................................................198
Chapter19
CompoundQuestions.....................................................................................................201
DefiningCompoundQuestions...........................................................................................................201
Validatingacompoundquestion........................................................................................................204
Compoundvs.Loop............................................................................................................................206
Chapter20
WorkingwithSample......................................................................................................207
TestingsampleinformationwithinmrStudio.....................................................................................209
AlternativetoSampleManagementtopassinformationintothesurvey.........................................213
Chapter21
WorkingwithQuotas......................................................................................................215
DefiningSurveyQuotas......................................................................................................................215
CheckingQuotas.................................................................................................................................218
QuotasInmrStudio.........................................................................................................................221
ActivationwithQuotas.......................................................................................................................222
Viewing&ChangingQuotas...............................................................................................................222
TableofContents
Chapter22
SurveyProgrammingFundamentals
CreatingMultiLingualProjects.......................................................................................227
OverviewofTranslatingStudiesinDimensions..................................................................................227
Settingthelanguagewithinthescript................................................................................................228
Askaquestiontocollectandsetthelanguage..................................................................................228
Setlanguagefromasamplefieldvariable..........................................................................................229
Tipsforcreatingmultilingualprojects...............................................................................................230
Chapter23
AdditionalinformationforAnalysis................................................................................231
AlternateTextforAnalysis..................................................................................................................231
AddingAnalysisContextwithmrStudio.........................................................................................231
Factors.................................................................................................................................................232
CreatingQuestionItemsforAnalysis..................................................................................................233
ElementTypes..................................................................................................................................234
AxisExpressions..............................................................................................................................236
Tipscreatinganalysiselements..........................................................................................................239
Summary.............................................................................................................................................239
VI