Zu Hauptinhalten wechseln

FV Decipher Unterstützung

Alle Themen, Ressourcen für FV Decipher benötigt.

 
decipher

Creating a Discrete Choice Model (DCM) Question

 

1: About Creating a DCM Question

The DCM is a special question type that requires attention. To create this question in your survey, you will:

  • Setup the design file
  • Setup the quota sheet
  • Copy the DCM question template into the survey
  • Modify the template to your design requirements

2: Setting Up the Design File

You can follow along by downloading this design file

Examples_dcm_basedesign.png

The first step is to extract our raw design like the one shown above into a tab-delimited text file. Open the design workbook using your favorite spreadsheet editor and save the design file in the tab-delimited format. In Microsoft Excel, there is an option for this. In LibreOffice Calc, you can save the sheet as comma-separate values ​​(CSV) and select the {TAB} character in the "Field delimiter" dropdown. Once done, change the extension of your file from ".txt" to ".dat". Verify that your tab-delimited text file is named design.dat. The file should look something like this:

The design file has now been downloaded and you should upload it to your project's root directory.

In the following instructions, we will be using the following:

  • When we refer to the number of questions we see in our exercise.
  • Concepts are related to the number of configurations (columns).
  • The term attributes are given by the number of columns after our concept column. We will later make this our legend text.

3: Setting up the Quota Sheet

Next, you need to create a quota to randomly select the versions each respondent will see. From your designfile, note how many total versions, and a quota sheet that will pick one of these. Name your markers "ver_1", "ver_2", ..., "ver_50". Illustrated below is our "Q24_DCM" sheet with a "DCM Versions" table that will randomly assign each respondent one of the 50 version markers. You may download this example quota file here .

The final quota is shown below, in a sheet called " Q24_DCM"

If you change the name of the markers, they should be still ending with _ # where # represents the version number as defined in the design file.

After you have created your quota sheet to match your design, upload quota.xlsto your project's directory. 

Note that you have only one quota.xlsfile uploaded to your system files. If you have already created a quota element in your survey, you will need to download the quota as a new tab in that file and rename and upload as quota.xls. For information on how to do this, see Quota Structure Download .

4: Copying the DCM Template into the Survey

After you have uploaded the design.datand quota.xlsfiles into your project, you can start adding in The Necessary DCM code. Copy and paste the following code into your survey.xmlDCM should be shown to respondents. This is a basic template and afterwards you will definitely need to make some modifications.

The next step is to modify your DCM design requirements.

<note> DCM Question Template --start - </ note> 
<exec when = "init"> 
def setupDCMFile (fname, fileDelimiter = "\ t"): 
    f = open ( "% s /% s"% (gv .survey.path, fname)) 
    dcmObj = [line.strip ("\ r \ n") split (fileDelimiter) for line in f.readlines ()] 

    d = {} 
    dcm_concepts = [] 

    for i, row in enumerate (dcmObj): 
        if i: 
            d [ "v% S_t% s_c% s"% (row [0], row [1], row [2])] = row [3] 
            if row [2] not in dcm_concepts : 
                dcm_concepts.append (row [2]) 

    concepts = [int (x) for x in dcm_concepts] 
    concepts.sort () 
    d [ "concepts"] = dcm_concepts 

    return d 

#set persistent items, dimensions: p.concept # _att # 
Def setupDCMItems (d, vt, prefix = "1"): 
    print "***** STAFF ONLY *****" 
    print "***** DCM Matrix *****" 
    print "Version_Task:% s "% vt 

    for concept in d.get (" concepts "): 
        attributes = d [ '% s_c% s"% (vt, concept)] 
        print "Concept% s:% s"% (concept, attributes) 

        for i, attr in enumerate (attributes): 
            p [ "concept% s_att% s"% (concept, i + 1)] = res [ "% s_att% S_Level% s"% (prefix, i + 1, attr)] 
            p [ " DcmLegend_att% s "% (i + 1)] = res ["% s_legend% s "% (prefix, i + 1)] 
</ exec> 

<exec when =" init "> 
Q1_dcm = setupDCMFile (" design.dat " ) 
</ exec> 

<quota overquota = "noqual" sheet = "Q1_DCM" /> 

<number label = "Q1_Version" size = "3" optional = "1" verify = "range (1.5)" where = "execute "> 
  <title> Q1 - DCM version </ title> 
  <exec> 
print p.markers 
for x in p.markers: 
  if" / Q1_DCM / ver_ "in x: 
    Q1_Version.val = int (x.split (" _ " ) [- 1]) 
    break 
  </ exec> 
</ number> 
<suspend /> 

<res label = "Q1_legend1"> Legend 1 </ res> 
<res label = "Q1_legend2"> Legend 2 </ res> 
<res label = "Q1_legend3"> Legend 3 </ res> 
<res label = "Q1_legend4"> Legend 4 </ res> 
<res label = "Q1_legend5"> Legend 5 </ res> 

<res label = "Q1_att1_level1"> att1-1 < 
Att1-3 </ res> 
<res label = "Q1_att1_level3"> att1-3 </ res> 
<res label = "Q1_att1_level4"> att1-4 </ res> 

< Res label = "Q1_att2_level1"> att2-1 </ res> 
<res label = "Q1_att2_level2"> att2-2 </ res> 
<res label = "Q1_att2_level3"> att2-3 </ res> 

<res label = "Q1_att3_level1 "Att3-1 </ res> 
<res label =" Q1_att4_level2 "> att3-1 </ res> 
<att label>" att3-1 </ res> 

<res label = "Q1_att3_level2"> att4-1 </ 
P> <p> 
<p> <p> 

<p> <p> <p> 
< p> <p> < p> <p> < p> <p> res label = "Q1_att5_level2"> att5-2 </ res> 
<res label = "Q1_att5_level3"> att5-3 </ res> 

<res label = "None text"> None of these </ res> 
<res label = "TopText "> Concepts </ res> 
<res label =" rowText "> select one option </ res> 

<exec> p.startTime = timeSpent () </ exec> 

<loopLabel =" Q1_dcm_loop "vars =" task "randomizeChildren = "0"> 
  <title> Q1 - DCM Loop </ title> 
  <blockLabel = "Q1_dcm_block" randomize = "0"> 
    <radioLabel = "Q1_ [loopvar: task]" optional = "0" surveyDisplay = "desktop" 
      ss: question class names = "Q1_dcm"> 
      <title> DCM title [DCMcount] </ title> 
      <alt> DCM task: [loopvar: task] </ alt> 
      <comment> Select one </ comment> 
      <exec> 
setupDCMItems (Q1_dcm , "V% s_t% s"% (Q1_Version.val, "[loopvar: task]", "Q1") 
p.DCMcount = "% d"% (Q1_dcm_loop_expanded.order.index ([loopvar: task] ) 
      </ Strong> </ strong> 
      </ strong> 
      </ strong> 
      </ strong> 
      <Col label = "c4"> Concept 4 </ col> 
      <col label = "c5" alt = "none of these" /> 
      <style_name = "question.header" mode = "before"> 
        <! [CDATA [ 
          <Style type = "text / css"> 
/ * add this only if you have scrollbars in IE7.8 
div.Q1_dcm { 
    overflow: hidden; 
} 
* / 
.Q1_dcm tr.legend th.legend { 
    font-weight: bold; 
    Width: auto; 
} 
.Q1_dcm th, .Q1_dcm td { 
    padding: 15px; 
} 
.Q1_dcm tr.dcm_even { 
    background-color: #FFFFFF; 
} 
.Q1_dcm tr.dcm_odd { 
    background-color: #EFEFEF; 
} 
.Q1_dcm td.dcm_legend { 
    font-weight: bold; 
    Text-align: left; 
    Width: 120px; 
} 
.Q1_dcm tr.dcm_even td.dcm_item, .Q1_dcm tr.dcm_odd td.dcm_item { 
    text-align: center; 
    Width: 120px; 
} 
          </ Style> 
        ]]> 
      </ style> 

<style arg: addNoneColumn = "1" arg: attributes = "5" arg: none text = "$ {} res.NoneText" arg: top = "$ {res.TopText } "Arg: yeslegend =" 1 "name =" question.top-legend "> 
<! [CDATA [ 
\ @if this.styles.ss.colLegendHeight 
<tr class =" legend top_legend $ {"GtTenColumns" if ec .column> $ 
\ 
"GtTenColumns" if ec .     $ $ (Top) </ th> \ @endif     $ (left)     $. $ ColEr $ > $ $ (colError) "> 
\ @endif 

\ @if yeslegend == '1' 
<th class =" dcm_legend2 " (legends)     $ (right) </ tr> \ @for x in range (1, int (attributes) +1) <tr class = "$ { 'dcm_% s'% [ 'odd', 'even'] [ x% 2]} "> \ @if yeslegend == '1'     <td class =" dcm_legend "> $ {p.get ( 'dcmLegend_att% d'% x)} </ td> \ @endif     <td class = "Dcm_item"> $ {p.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this.cols] [0], x)) </ td>     <td class = "dcm_item"> $ {p.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle (%)% D_att% d '% this.cols] [1], x))} </ td>     <td class = "dcm_item"> $ {p.get ([C.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this.cols] [2], x))} </ td>     <td class = "dcm_item "> $ {P.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this.cols] [3 ] = "1 ' \ @if x == 1      <td rowspan =" $ {int ($ (attributes)) "" style = "border-top: none ; text-align: center; "> <b> $ (none text) </ b> </ td> \ @endif \ @endif </ tr> \ @end <tbody> ]]> </ style> <style arg: Row = "$ {res.rowText}" arg: yeslegend = "1" name = "question.row"> <! [CDATA [ \ @if this.styles.ss.rowHeight     <tr class = "$ (style) colCount - $ (colCount) $ style = "height: $ {this.styles.ss.rowHeight};"> \ @else     <tr class = "$ (style) colCount - $ (colCount)"> \ @endif \ @if yeslegend == '1'     <td class = "dcm_legend"> $ (row) </ td> \ @endif $ (left) $ (element) $ (right) </ tr> ]]> </ style> <style Arg: addNoneColumn = "1" name = "question.top-legend-item"> <! [CDATA [ \ @if this.styles.ss.colWidth     <th id = "$ (this.label) _ $ (col. Label) "class =" dcm_legend $ {col.styles.ss.colClassNames) $ {col.group.styles.ss.groupClassNames if col.group else ""} "style =" width: $ {This.styles.ss.colWidth}; Min-width: $ {this.styles.ss.colWidth} ">         $ (text)     </ th> \ @else \ @if addNoneColumn == '1' and col.index == (ec.colCount-1)     < Th id = "$ (this.label) _ $ (col.label)" style = "border-bottom: none; width: 125px; ">         $ (text)     </ th> \ @else     <th id =" $ (this.label) _ $ (col.label) "class =" legend survey-q-grid colle quietly $ (col .styles.ss.colClassNames) $ {col.group.styles.ss.groupClassNames if col.group else ""} ">         $ (text)     </ th> \ @endif \ @endif ]]> </ style>     < / radio>     <suspend />   </ block>   <looprow label = "1">     <loopvar name = "task"> 1 </ loopvar>   </ looprow>   <looprow label = "2">     <loopvar name = "task "> 2 </ loopvar>   </ looprow>   <looprow label =" 3 ">     <loopvar name =" task "> 3 </ loopvar>   </ looprow>   <looprow label =" 4 ">     <loopvar name =" task "> 4 </ loopvar>   </ looprow>   <looprow label =" 5 ">     <loopvar name =" task "> 5 </ loopvar>   </ looprow> </ loop> <float label =" Q1_Timer "size =" 15 "where =" execute ">   <title> Q1 - DCM timer (Minutes) </ title>   <exec> Q1_Timer.val = (timespent () - p.startTime) / 60.0 </ exec> </ float> <note > DCM Question Template --End - </ note>




































































































5: Updating the Template

Now that we have the DCM question in place, you will need to modify it to match your design specification.

5.1: Updating the DesignFileName

< 
Exec when = "init"> Q1_dcm = setupDCMFile ("design.dat") 
</ exec>

This is where you initialize the DCM class. It takes in the name of the design file you uploaded to the project's directory. Update design.dat, if needed, to reflect the name of the design file you uploaded to your project directory.

5.2: Updating the Sheet Name in the Quota File

The following code calls the "Q1_DCM" quota sheet and will assign the respondent a version number. You should update the sheet name in the quota. For the sample design, this is set to " Q24_DCM."

<Quota overquota = "noqual" sheet = "Q1_DCM" />

5.3: Updating the Range Specification

Update the range ( verify="range(1,5)") on the _version question to match the number of versions in the quota for your DCM question. For the sample design, this should be set to range(1,50"

<number label = "Q1_Version" size = "3" optional = "1" verify = "range (1.5)" where = "execute"> 
  <title> Q1 - DCM version </ title> 
  <exec> 
print p. markers 
for x in p.markers: 
  if "/ Q1_DCM / ver_" in x: 
    Q1_Version.val = int (x.split ( "_") [- 1]) 
    break 
  </ exec> 
</ number> 
<suspend />

5.4: Updating the Sheet Name / Default Version Markers

If you updated the quota sheet name or the default version markers, be sure to update the following line of code ( if "/Q1_DCM/ver_" in x:) to reflect your changes.

<P> for x in p.markers: <br> if "/ Q1_DCM / ver_" in x: <br> Q1_Version.val = 
int (x.split ("_") [- 1]) <br> break < Br> </ exec> <br> </ number> <br> <suspend /> </ p>

5.5: Updating the Resource Tags

In this update you 're going to replace the tags ( <res>) with attributes related to your design file. First extract the attribute text elements that will be shown to the respondent. Refer to the attributes text sheet in the sample design file .

The DCM function uses the <res>tags above to properly show the text based on the design file. See the screenshot below to get a better idea of ​​how this works:

Examples_dcm_defaultattributes.png

Design files vary drastically from project to project. In this example, it was noted in the design file that there are many blank attributes and the corresponding cells should not display any text. Your design file may not contain any blank cells.

5.5.1: Resource Tags for DCM Legends

Create the resource tags for the DCM with the same naming format as the template Q # _Legend #. If no DCM legends exist, skip this step. 

<Res label = "Q1_legend1"> Legend 1 </ res> 
<res label = "Q1_legend2"> Legend 2 </ res> 
<res label = "Q1_legend3"> Legend 3 </ res> 
<res label = "Q1_legend4"> Legend 4 </ res> 
<res label = "Q1_legend5"> Legend 5 </ res>

DCM legend resource tags:

<Res label = "Q1_legend1"> </ re> 
<res label = "Q1_legend2"> Additional GameLevels 
</ res> 
<res label = "Q1_legend3" > Additional Characters </ res> 
<res label = "Q1_legend5"> Additional In Game Items </ res> 
<res label = "Q1_legend6"> AdditionalCosmeticItems </ res> 
<res label = "Q1_legend7"> Additional Boosters < / res> 
<res label = "Q1_legend8"> In-game currency </ res> 
<res label = "Q1_legend9"> Exclusive Items </ res> 
<res label = "Q1_legend10"> Ads </ res> 
<res label = "Q1_legend11"> Subscription </ res> 
<res label = "Q1_legend12"> Upfront Game Client Cost </ res>

5.5.2: Resource Tags for Each Level

Create the resource tags for each level. Use the naming conventions Q # _att # _level # where the attribute number is the column from which it is pulling (ie the attribute count). The level is the number of the column for that particular row.

<res label = "Q1_att1_level1"> att1-1 </ res> 
<res label = "Q1_att1_level2"> att1-2 </ res> 
<res label = "Q1_att1_level3"> att1-3 </ res> 
<res label = " Q1_att2_level3 "> att2-1 </ res> 

<res label =" Q1_att2_level2 
"> att2-4 </ res> 
<res label =" Q1_att2_level3 "> att2- 3 

att3-3 </ res> <res label = "Q1_att3_level1"> att3-1 </ res> 
<res label = "Q1_att3_level2"> att3-2 </ res> 
<res label = "Q1_att3_level3"> att3-3 </ res> 

<res label = "Q1_att4_level1"> att4-1 </ res> 
<res label = "Q1_att4_level2"> att4-2 </ res> 
<res label = "Q1_att4_level3"> att4-3 </ res> 

<res label = " Q1_att5_level1 "> att5-1 </ res> 
<res label =" Q1_att5_level2 "> att5-2 </ res> 
<res label =" Q1_att5_level3 "> att5-3 </ res>

To view the sample, you have the following resources:

<Res label = "Q1_att1_level1"> First person shooter (FPS) </ res> 
<res label = "Q1_att1_level2"> Third person shooter (TPS) / Action </ res> 
<res label = "Q1_att1_level3"> Role- </ 
P> <p> </ p> <p> </ 
p> <p> </ p> 
<p> > 
<res label = "Q1_att1_level7"> Real-time strategy </ res> 
<res label = "Q1_att1_level8"> Sports </ res> 
<res label = "Q1_att1_level9"> Music </ res> 
<res label = "Q1_att1_level10" > Fighting </ res> 
<res label = "Q1_att1_level11"> Massive online battlearena (MOBA) </ res> 

<res label = "Q1_att2_level0"> </ res> 
<res label = "Q1_att2_level1"> </ res> 
< Res label = "Q1_att2_level2"> Additional story content is available for purchase in a cash shop </ res> 

<res label = "Q1_att3_level0"> </ res> 
<res label = "Q1_att3_level1"> </ res> 
<res label = " 

" Q1_att4_level1 "> </ res> 
<res label =" Q1_att4_level2. "Q1_att4_level1"> Q1_att4_level1 "> Q1_att4_level1"> Q1_att4_level1 "> Q1_att4_level2"> Q1_att4_level2 "> Q1_att4_level2"> Q1_att4_level2 "> Q1_att4_level2"> Q1_att4_level2 "> Q1_att4_level2"> Q1_att4_level2 "> 
Q1_att "Reside in a cash shop </ res> 

<res label =" Q1_att5_level0 "> </ res> 
<res label =" Q1_att5_level1 "> </ res> 
<res label =" Q1_att5_level2 "> Game items like weapons, vehicles and equipment are available for purchase in a cash shop </ res> 

<res label = "Q1_att6_level0"> </ res> 
<res label = "Q1_att6_level1"> </ res> 
<res label = "Q1_att6_level2 "> Cosmetic items and customizations for you characters are available for purchase in a cash shop </ res> 

<res label =" Q1_att7_level0 "> </ res> 
<res label =" Q1_att7_level1 "> </ res> 
<res label =" Q1_att7_level2 "> Boosters and power-ups are available for purchase in a cash shop </ res> 

<res label =" Q1_att8_level0 "> </ res> 
<res label =" Q1_att8_level1 "> The game features in-game currency did can only be earned </ res> 
<res label = "Q1_att8_level2"> The game features in-game currency did kann earned or purchased with real money </ res> 
<res label = "Q1_att8_level3"> The game features an in-game currency did can only be earned and a separate currency did can only be purchased with real money </ res> 

<res label = "Q1_att9_level0"> </ res> 
<res label = "Q1_att9_level1"> </ res> 
<res label = " Q1_att9_level2 "> The game features exclusive in-game items that can only be used with real money </ res> 
<res label =" Q1_att9_level3 "> / res> 

<res label = "Q1_att10_level0"> </ res> 
<res label = "Q1_att10_level1"> The game is free of all advertising </ res> 
<res label = "Q1_att10_level2"> The game features advertising </ res> 

<res label = "Q1_att11_level0"> </ res> 
<res label = "Q1_att11_level1"> There is no subscription required to play </ res> 
<res label = "Q1_att11_level2"> The game requires you to pay a subscription each month in order to play </ res> 

<res label = "Q1_att12_level1"> game is free </ res> 
<res label = "Q1_att12_level2"> game is available for $ 2.50 </ res> 
<res label = "Q1_att12_level3"> game is available for $ 5 </ res> 
<res label = "Q1_att12_level4"> game is available for $ 10 </ res> 
<res label = "Q1_att12_level5"> game is available for $ 15 </ res> 
<res label = "Q1_att12_level6"> game is available for $ 20 </ res> 
<res label = "Q1_att12_level7"> game is available for $ 25 </ res> 
<res label = "Q1_att12_level8"> game is available for $ 30 </ res> 
<res label = "Q1_att12_level9"> game Is available for $ 40 </ res> 
<res label = "Q1_att12_level10"> Game is available for $ 50 </ res>

5.5.3 Resource Tags for Specifying Text

Update the following resource tags to reflect the desired text you want for the none column, top text, and text before the elements respectively. You can set these resources tags to "blank" if desired.

<Res label = "NoneText"> None of these </ ref> 
<res label = "TopText"> Concepts </ res> 
<res label = "rowText"> Select one option </ res>

5.6: Updating the Question & the Loop

This is the DCM question element. It's incorporated into a <loop> and will run for as many times.

<Loop label = "Q1_dcm_loock" vars = "task" randomizeChildren = "0"> 
  <title> Q1 - DCM Loop </ title> 
  <blockLabel = "Q1_dcm_block" randomize = "1"> 
    <radiolabel = "Q1_ [loopvar : task] "optional =" 0 "survey display =" desktop " 
      ss: question class names =" Q1_dcm "> 
      <title> DCM title [DCMcount] </ title> 
      <alt> DCM task: [loopvar: task] </ alt> 
      < Comment> Select one </ comment> 
      <exec> 
setupDCMItems (Q1_dcm, "v% s_t% s"%, Q1_Version.val, "[loopvar: task]", "Q1") 
p.DCMcount = "% d"% (1) + 1) 
      </ exec> 
      <col label = "c1"> Concept 1 </ col> 
      <col label = "c2"> Concept 2 </ col> 
      <Col label = "c3"> Concept 3 </ col> 
      <col label = "c4"> Concept 4 </ col> 
      <col label = "c5" alt = "None of these" /> 
      <style name = "question ".header" mode = "before> 
        <! [CDATA [ 
          text / css" <style type => ' 
/ * add this only if you have scrollbars in IE7,8 
div.Q1_dcm { 
    overflow: hidden; 
} 
* / 
.Q1_dcm tr.legend th.legend { 
    font-weight: bold; 
    Width: auto; 
} 
.Q1_dcm th, .Q1_dcm td { 
    padding: 15px; 
} 
.Q1_dcm tr.dcm_even { 
    background-color: #FFFFFF; 
} 
.Q1_dcm tr.dcm_odd { 
    background-color: #EFEFEF; 
} 
.Q1_dcm td.dcm_legend { 
    font-weight: bold; 
    Text-align: left; 
    Width: 120px; 
} 
.Q1_dcm tr.dcm_even td.dcm_item, .Q1_dcm tr.dcm_odd td.dcm_item { 
    text-align: center; 
    Width: 120px; 
} 
          </ Style> 
        ]]> 
      </ style> 

<style arg: addNoneColumn = "1" arg: attributes = "5" arg: none text = "$ {} res.NoneText" arg: top = "$ {res.TopText } "Arg: yeslegend =" 1 "name =" question.top-legend "> 
<! [CDATA [ 
\ @if this.styles.ss.colLegendHeight 
<tr class =" legend top_legend $ {"GtTenColumns" if ec .column> $ 
\ 
"GtTenColumns" if ec .     $ $ (Top) </ th> \ @endif     $ (left)     $. $ ColEr $ > $ $ (colError) "> 
\ @endif 

\ @if yeslegend == '1' 
<th class =" dcm_legend2 " (legends)     $ (right) </ tr> \ @for x in range (1, int (attributes) +1) <tr class = "$ { 'dcm_% s'% [ 'odd', 'even'] [ x% 2]} "> \ @if yeslegend == '1'     <td class =" dcm_legend "> $ {p.get ( 'dcmLegend_att% d'% x)} </ td> \ @endif     <td class = "Dcm_item"> $ {p.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this.cols] [0], x)) </ td>     <td class = "dcm_item"> $ {p.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle (%)% D_att% d '% this.cols] [1], x))} </ td>     <td class = "dcm_item"> $ {p.get ([C.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this.cols] [2], x))} </ td>     <td class = "dcm_item "> $ {P.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this.cols] [3 ] = "1 ' \ @if x == 1      <td rowspan =" $ {int ($ (attributes)) "" style = "border-top: none ; text-align: center; "> <b> $ (none text) </ b> </ td> \ @endif \ @endif </ tr> \ @end <tbody> ]]> </ style> <style arg: Row = "$ {res.rowText}" arg: yeslegend = "1" name = "question.row"> <! [CDATA [ \ @if this.styles.ss.rowHeight     <tr class = "$ (style) colCount - $ (colCount) $ style = "height: $ {this.styles.ss.rowHeight};"> \ @else     <tr class = "$ (style) colCount - $ (colCount)"> \ @endif \ @if yeslegend == '1'     <td class = "dcm_legend"> $ (row) </ td> \ @endif $ (left) $ (element) $ (right) </ tr> ]]> </ style> <style Arg: addNoneColumn = "1" name = "question.top-legend-item"> <! [CDATA [ \ @if this.styles.ss.colWidth     <th id = "$ (this.label) _ $ (col. Label) "class =" dcm_legend $ {col.styles.ss.colClassNames) $ {col.group.styles.ss.groupClassNames if col.group else ""} "style =" width: $ {This.styles.ss.colWidth}; Min-width: $ {this.styles.ss.colWidth} ">         $ (text)     </ th> \ @else \ @if addNoneColumn == '1' and col.index == (ec.colCount-1)     < Th id = "$ (this.label) _ $ (col.label)" style = "border-bottom: none; width: 125px; ">         $ (text)     </ th> \ @else     <th id =" $ (this.label) _ $ (col.label) "class =" legend survey-q-grid colle quietly $ (col .styles.ss.colClassNames) $ {col.group.styles.ss.groupClassNames if col.group else ""} ">         $ (text)     </ th> \ @endif \ @endif ]]> </ style>     < / radio>     <suspend />   </ block>   <looprow label = "1">     <loopvar name = "task"> 1 </ loopvar>   </ looprow>   <looprow label = "2">     <loopvar name = "task "> 2 </ loopvar>   </ looprow>   <looprow label =" 3 ">     <loopvar name =" task "> 3 </ loopvar>   </ looprow>   <looprow label =" 4 ">     <loopvar name =" task "> 4 </ loopvar>   </ looprow>   <looprow label =" 5 ">     <loopvar name =" task "> 5 </ loopvar>   </ looprow> </ loop>






























































































The DCM question and loop.

5.6.1: Setting the Randomization

<Loop label = "Q1_dcm_loop" vars = "task" randomizeChildren = "0">

If the client requests to randomize tasks in addition to what the randomization design file is already doing, change the randomizeChildrenvalue to " 1". By default it is set to "0" and it is typically left unchanged.

If you want to change the randomizeChildrenvalue to " 1", then make sure that you have changed randomize="0"to randomize="1"the next block as shown below.

<Block label = "Q1_dcm_block" randomize = "1">

  5.6.2: Updating the <radio> Question's <title>and <comment>Attributes

Title and comment tags represent the question and instruction text (respectively) that display to respondents for each task in the DCM. You shoulderstand update the text between the <title>and <comment>tags to match your questionnaire.

By default, the template includes [DCMcount]the <title>following in the tag to let respondents know which task of the DCM they are on.

<Title 
> DCM Task: [loopvar: task] </ alt> 
<comment> Select one </ comment>

5.6.3: Specifying Columns

Update the number of columns to match the number of concepts in the design. The template currently has a None of this column in place. If this is not a requirement for your client, you should remove this column.

<Col label = "c1"> Concept 1 </ col> 
<col label = "c2"> Concept 2 </ col> 
<col label = "c3"> Concept 3 </ col> 
<col label = "c4"> Concept 4 </ col> 
<col label = "c5" alt = "None of these" />

5.6.4: Setting Configurable Attributes

<Style arg: addNoneColumn = "1" arg: attributes = "5" arg: noneText = "$ {res.NoneText}" 
      arg: top = "$ {res.TopText}" arg: yeslegend = "1" name = Question.top-legend ">

Set these attributes to the following values:

  • If the client requires a "None" column, then set the arg: addNoneColumn to 1 ( arg:addNoneColumn="1"). Otherwise, set this attribute to 0. Complete this task in two places within the loop.
  • Set arg: attributes to the count of attributes in the DCM design specification (eg arg:attributes="12")
  • If your DCM question has a legend, set arg: yeslegend to 1 ( arg:yeslegend="1"). Otherwise, set it to 0. Complete this task in two places within the loop.

5.6.5: Updating the question-top Legend Style

<Td class = "dcm_item"> $ {p.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle-Col-% d'% this.uid) or This.cols] [0], x)) </ td> 
<td class = "dcm_item"> $ {p.get ('concept% d_att% d'% ([c.index + 1 for c in p. Get ('shuffle-Col-% d'% this.uid) or this.cols] [1], x))} </ td> 
<td class = "dcm_item"> $ {p.get ('concept% d_att % D '% ([c.index + 1 for c in p.get (' shuffle col% d '% this.uid) or this.cols] [2], x))} </ td> 
<td Class = "dcm_item"> $ {p.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this. Cols] [3], x))} </ td>

In the question-top-legend style, verify that the number of td blocks match the number of columns in your DCM design. Currently, the template is set for two columns (0-3). If you want to add a column for 5 columns, add an additional td block as shown above, and set the number to inside brackets to 4 (eg [4]).

You do not need to add a block for the None column as that is in the next section of code.

5.6.6: Updating the Number of Tasks

Update the number of tasks looprowto your design file. The DCM template loop is set up for 5 tasks which indicates 5 questions to each respondent. The example design file is set to show 14 different questions to each respondent. To match the design, multiple <looprow> tags are added as shown.

  <Looprow label = "1"> <loopvar name = "task"> 1 </ loopvar> </ looprow> 
  <looprow label = "2"> <loopvar name = "task"> 2 </ loopvar> </ looprow> 
  <Looprow label = "3"> <loopvar name = "task"> 3 </ loopvar> </ looprow> 
  <looprow label = "4"> <loopvar name = "task"> 4 </ loopvar> </ looprow> 
  <Looprow label = "5"> <loopvar name = "task"> 5 </ loopvar> </ looprow> 
  <looprow label = "6"> <loopvar name = "task"> 6 </ loopvar> </ looprow> 
  <Looprow label = "7"> <loopvar name = "task"> 7 </ loopvar> </ looprow> 
  <looprow label = "8"> <loopvar name = "task"> 8 </ loopvar> </ looprow> 
  <Looprow label = "9"> <loopvar name = "task"> 9 </ loopvar> </ looprow> 
  <looprow label = "10"> <loopvar name = "task"> 10 </ loopvar> </ looprow> 
  <Loop loop label = "11"> <loopvar name = "task"> 11 </ loopvar> </ looprow> 
  <looprow label = "12"> <loopvar name = "task"> 12 </ loopvar> </ looprow> 
  <Looprow label = "13"> <loopvar name = "task"> 13 </ loopvar> </ looprow> 
  <looprow label = "14"> <loopvar name = "task"> 14 </ loopvar> </ looprow>

5.7: Globally Updating the DCM Question Label

From within the template, do a global find and replace to replace all instances of Q1 to match your question label. For the sample design, the question label is updated to Q24.

6: Results of Template Modifications

Below is the revised code to fit the needs of our example design file. 

<note> DCM Question Template --start - </ note> 
<exec when = "init"> 
def setupDCMFile (fname, fileDelimiter = "\ t"): 
    f = open ( "% s /% s"% (gv .survey.path, fname)) 
    dcmObj = [line.strip ("\ r \ n") split (fileDelimiter) for line in f.readlines ()] 

    d = {} 
    dcm_concepts = [] 

    for i, row in enumerate (dcmObj): 
        if i: 
            d [ "v% S_t% s_c% s"% (row [0], row [1], row [2])] = row [3] 
            if row [2] not in dcm_concepts : 
                dcm_concepts.append (row [2]) 

    concepts = [int (x) for x in dcm_concepts] 
    concepts.sort () 
    d [ "concepts"] = dcm_concepts 

    return d 

#set persistent items, dimensions: p.concept # _att # 
Def setupDCMItems (d, vt, prefix = "1"): 
    print "***** STAFF ONLY *****" 
    print "***** DCM Matrix *****" 
    print "Version_Task:% s "% vt 

    for concept in d.get (" concepts "): 
        attributes = d [ '% s_c% s"% (vt, concept)] 
        print "Concept% s:% s"% (concept, attributes) 

        for i, attr in enumerate (attributes): 
            p [ "concept% s_att% s"% (concept, i + 1)] = res [ "% s_att% S_Level% s"% (prefix, i + 1, attr)] 
            p [ " DscLegend_att% s "% (i + 1)] = res ["% s_legend% s "% (prefix, i + 1)] 
</ exec> 

<exec when =" init "> 
Q24_dcm = setupDCMFile (" design.dat " ) 
</ exec> 

<quota overquota = "noqual" sheet = "Q24_DCM" /> 

<number label = "Q24_Version" size = "3" optional = "1" verify = "range (1,50)" where = "execute " 
  <Q24 - DCM Version </ title> 
  <exec> 
print p.markers 
for x in p.markers: 
  if" / Q24_DCM / ver_ "in x: 
    Q24_Version.val = int (x.split (" _ " ) [- 1]) 
    break 
  </ exec> 
</ number> 
<suspend /> 

<res label = "Q24_legend1"> Genre </ res> 
<res label = "Q24_legend2"> Additional Story content </ res> 
<res label "Additional Characters </ res> 
<res label =" Q24_legend4 "> Additional Characters </ res> 
<res label =" Q24_legend4 "> Additional Characters </ res> 
<res label =" Q24_legend4 " > Additional Items </ 
b> </ b> 
<b> 
<b> <b > <b> <b > <b> Res 
"=" res "," 
res "," res "," 
res "," res "," 

res "," res "," res "," res " (RPG) </ 
ref > <res label = "Q24_att1_level3 "> First person shooter (FPS) </ res> <res label = "Q24_att1_level2"> Third person shooter (TPS) 
res> 
<res label = "Q24_att1_level4"> Strategy </ res> 
<res label = "Q24_att1_level5"> simulation </ res> 
<res label = "Q24_att1_level6"> casual / puzzle / card </ res> 
<res label = " Q24_att1_level7 "> Real-time strategy </ res> 
<res label =" Q24_att1_level8 "> Sports </ res> 
<res label =" Q24_att1_level9 "> Music </ res> 
<res label =" Q24_att1_level10 "> Fighting </ res> 
<Res label = "Q24_att2_level11"> <res label = "Q24_att2_level11"> resolved live battle arena (MOBA) </ res 

> 
<res label = "Q24_att2_level0"> </ res> 
<res label = "Q24_att2_level1" > Additional story content is available for purchase in a cash shop </ res> 

<res label = "Q24_att3_level0"> </ res> 
<res label = "Q24_att3_level1"> </ res> 
<res label = "Q24_att3_level2"> Additional levels (S) of the game are available for purchase in a cash shop </ res> 

<res label = "Q24_att4_level0"> </ res> 
<res label = "Q24_att4_level1"> </ res> 
<res label = "Q24_att4_level2"> Additional characters are available For 

resale in a cash shop </ res> <res label = "Q24_att5_level0"> </ res> 
<res label = "Q24_att5_level1"> </ res> 
<res label = "Q24_att5_level2"> In-game items like weapons, vehicles And reside in a cash shop </ res> 

<res label = "Q24_att6_level0"> </ res> 
<res label = "Q24_att6_level1"> </ res> 
<res label = "Q24_att6_level2"> Cosmetic items and customizations for you characters are available for purchase in a cash shop </ res> 

<res label = "Q24_att7_level0"> </ res> 
<res label = "Q24_att7_level1"> </ res> 
<res label = "Q24_att7_level2"> Boosters and power -ups are available for purchase in a cash shop </ res> 

<res label = "Q24_att8_level0"> </ res> 
<res label = "Q24_att8_level1"> 
<Res label = "Q24_att8_level3"> The game features in-game currency 
can only be earned and a separate currency did can only be purchased with real money </ res> 

<res label = "Q24_att9_level0"> </ res> 
<res label = "Q24_att9_level1"> </ res> 
<res label = "Q24_att9_level2"> The game features 
The game features exclusive in-game items that can be earned at the same time with the real money </ res> 

<res label </ res> <res label = "Q24_att9_level3"> = "Q24_att10_level1"> 
The game is free of all advertising </ res> 
<res label = "Q24_att10_level2"> The game features advertising </ res> 

<res label = "Q24_att11_level0 "> </ Res> 
<res label =" Q24_att11_level1 "> There is no subscription required to play </ res> 
<res label =" Q24_att11_level2 "> The game requires you to pay a monthly subscription > 

<res label = "Q24_att12_level1"> game is free </ res> 
<res label = "Q24_att12_level2"> game is available for $ 2.50 </ res> 
<res label = "Q24_att12_level3"> game is available for $ 5 </ res> 
<res label = "Q24_att12_level4"> game is available for $ 10 </ res> 
<res label = "Q24_att12_level5"> game is available for $ 15 </ res> 
<res label = "Q24_att12_level6"> game is available for $ 20 </ res > 
<res label = "Q24_att12_level7"> game is available for $ 25 </ res> 
<res label = "Q24_att12_level8"> game is available for $ 30 </ res> 
<res label = "Q24_att12_level9"> game is available for $ 40 </ res> 
<res label = "Q24_att12_level10"> game is available for $ 50 </ res> 

<res label = "None text"> None of these </ res> 
<res label = "TopText"> Concepts </ res> 
<res label = "RowText"> select one option </ res> 

<exec> p.startTime = timeSpent () </ exec> 

<loopLabel = "Q24_dcm_loop" vars = "task" randomizeChildren = "0"> 
  <title> Q24 - DCM Loop </ title> 
  <blockLabel = "Q24_dcm_block" randomize = "0"> 
    <radiolabel = "Q24_ [loopvar: task]" optional = "0" surveyDisplay = "desktop" 
      ss: questionClassNames = "Q24_dcm"> 
      <title > DCM 
      Task: [loopvar: task] </ alt> 
      <comment> Select one </ comment> 
      <exec> 
setupDCMItems (Q24_dcm, "v% s_t% s"% Q24_dv_expanded.order.index 
([loopvar: task] -1) + 1) 
      </ exec> 
      <col Label = "c1"> Concept 
      2 </ col> 
      <col label = "c3"> Concept 3 </ col> 
      <col label = "c4"> Concept 4 </ col> 
      <col label = "c5" alt = "None of these" /> 
      <style name = "question.header" mode = "before"> 
        <! [CDATA [ 
          <style type = "text / css"> 
/ * Add this only if you have scrollbars in IE7.8 
div.Q24_dcm { 
    overflow: hidden; 
} 
* / 
.Q24_dcm tr.legend th.legend { 
    font-weight: bold; 
    Width: auto; 
} 
.Q24_dcm th, .Q24_dcm td { 
    padding: 15px; 
} 
.Q24_dcm tr.dcm_even { 
    background-color: #FFFFFF; 
} 
.Q24_dcm tr.dcm_odd { 
    background-color: #EFEFEF; 
} 
.Q24_dcm td.dcm_legend { 
    font-weight: bold; 
    Text-align: left; 
    Width: 120px; 
} 
.Q24_dcm tr.dcm_even td.dcm_item, .Q24_dcm tr.dcm_odd td.dcm_item { 
    text-align: center; 
    Width: 120px; 
} 
          </ Style> 
        ]]> 
      </ style> 

<style arg: addNoneColumn = "1" arg: attributes = "12" arg: none text = "$ {} res.NoneText" arg: top = "$ {res.TopText } "Arg: yeslegend =" 1 "name =" question.top-legend "> 
<! [CDATA [ 
\ @if this.styles.ss.colLegendHeight 
<tr class =" legend top_legend $ {"GtTenColumns" if ec .column> $ 
\ 
"GtTenColumns" if ec .     $ $ (Top) </ th> \ @endif     $ (left)     $. $ ColEr $ > $ $ (colError) "> 
\ @endif 

\ @if yeslegend == '1' 
<th class =" dcm_legend2 " (legends)     $ (right) </ tr> \ @for x in range (1, int (attributes) +1) <tr class = "$ { 'dcm_% s'% [ 'odd', 'even'] [ x% 2]} "> \ @if yeslegend == '1'     <td class =" dcm_legend "> $ {p.get ( 'dcmLegend_att% d'% x)} </ td> \ @endif     <td class = "Dcm_item"> $ {p.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this.cols] [0], x)) </ td>     <td class = "dcm_item"> $ {p.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle (%)% D_att% d '% this.cols] [1], x))} </ td>     <td class = "dcm_item"> $ {p.get ([C.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this.cols] [2], x))} </ td>     <td class = "dcm_item "> $ {P.get ('concept% d_att% d'% ([c.index + 1 for c in p.get ('shuffle col% d'% this.uid) or this.cols] [3 ] = "1 ' \ @if x == 1      <td rowspan =" $ {int ($ (attributes)) "" style = "border-top: none ; text-align: center; "> <b> $ (none text) </ b> </ td> \ @endif \ @endif </ tr> \ @end <tbody> ]]> </ style> <style arg: Row = "$ {res.rowText}" arg: yeslegend = "1" name = "question.row"> <! [CDATA [ \ @if this.styles.ss.rowHeight     <tr class = "$ (style) colCount - $ (colCount) $ style = "height: $ {this.styles.ss.rowHeight};"> \ @else     <tr class = "$ (style) colCount - $ (colCount)"> \ @endif \ @if yeslegend == '1'     <td class = "dcm_legend"> $ (row) </ td> \ @endif $ (left) $ (element) $ (right) </ tr> ]]> </ style> <style Arg: addNoneColumn = "1" name = "question.top-legend-item"> <! [CDATA [ \ @if this.styles.ss.colWidth     <th id = "$ (this.label) _ $ (col. Label) "class =" dcm_legend $ {col.styles.ss.colClassNames) $ {col.group.styles.ss.groupClassNames if col.group else ""} "style =" width: $ {This.styles.ss.colWidth}; Min-width: $ {this.styles.ss.colWidth} ">         $ (text)     </ th> \ @else \ @if addNoneColumn == '1' and col.index == (ec.colCount-1)     < Th id = "$ (this.label) _ $ (col.label)" style = "border-bottom: none; width: 125px; ">         $ (text)     </ th> \ @else     <th id =" $ (this.label) _ $ (col.label) "class =" legend survey-q-grid colle quietly $ (col .styles.ss.colClassNames) $ {col.group.styles.ss.groupClassNames if col.group else ""} ">         $ (text)     </ th> \ @endif \ @endif ]]> </ style>     < / radio>     <suspend />   </ block>   <looprow label = "1">     <loopvar name = "task"> 1 </ loopvar>   </ looprow>   <looprow label = "2">     <loopvar name = "task "> 2 </ loopvar>   </ looprow>   <looprow label =" 3 ">     <loopvar name =" task "> 3 </ loopvar>   </ looprow>   <looprow label =" 4 ">     <loopvar name =" task "> 4 </ loopvar>   </ looprow>   <looprow label =" 5 ">     <loopvar name =" task "> 5 </ loopvar>   </ looprow> <looprow label =" 6 ">     <loopvar name =" task "> 6 </ loopvar>   </ looprow> <looprow label =" 7 ">     <loopvar name =" task "> 7 </ loopvar>   </ looprow> <looprow label =" 8 ">     <loopvar name =" task "> 8 </ loopvar>   </ looprow> <looprow label =" "> 9     <loopvar name =" task "> 9 </ loopvar>   </ looprow> <looprow label =" 10 ">     <loopvar name =" task "> 10 </ loopvar>   </ looprow> <looprow label =" 11 ">     <loopvar name =" task "> 11 </ loopvar>   </ looprow> <looprow label =" 12 ">     <loopvar name =" task "> 12 </ loopvar>   </ looprow> <looprow label =" 13 ">     <loopvar name =" task "> 13 </ loopvar>   </ looprow> <looprow label =" 14 ">     <loopvar name =" task "> 14 </ loopvar>   </ looprow> </ loop> <float label =" Q24_Timer "size =" 15 "where =" execute ">   <title> Q24 - DCM timer (Minutes) </ title>   <exec> Q24_Timer.val = (timeSpent () - p.startTime) / 60.0 </ exec> </ float> <note> DCM QuestionTemplate --End - </ note>








































































































































7: Question Results

Click here to the results of DCM template reflecting the sample design (includes a "None" column).

Click here to view the DCM template without the "None" column.

The example design file used in this project can be found here . The example quota file used in this example is available here .

If you want to change the look of this question, you can do this by using the XML style system.