Developer Documentation Library > Data Model > Extending the UNICOM Intelligence Data Model > Creating a Metadata Source Component (MDSC) > Populating the MDM Document > Setting up basic questions
 
Setting up basic questions
This topic covers creating basic categorical, numeric, and open-ended questions.
1 Create a variable and give it a name.
The variable represents the question.
2 Add the variable to the Document's Fields collection.
When you add the variable to the Document, MDM automatically creates a VariableInstance object, which represents the data storage for the question. If the variable is part of a loop or a grid, or has helper fields, there can be more than one VariableInstance object for the question. MDM generates a unique FullName for each VariableInstance, based on its place in the Document. If these FullNames are unsuitable for your data source, you need to set up alias names on the VariableInstance objects.
3 Populate the variable's labels.
The variable's Labels property enables you to store a matrix of texts. The following table provides some examples of how this works for the base language. Translations of each of these text can be stored in each language defined in the Document.Languages collection.
User context
Label type
Typical use
Example
Question
Label
Question text
What type of school or college do you attend?
Question
Shortname
Short question name
Q5
Question
Instruction
Instruction to interviewer / respondent
Only if answered Yes to Q4
Analysis
Label
Variable description for use during analysis
School or college type
Analysis
Shortname
Not applicable
 
Analysis
Instruction
Not applicable
 
4 Set the variable's data type according to the type of data the variable will store:
Data type constant
Description
mtCategorical
Categorical variable
mtDate
Date and time stored in standard Microsoft format
mtDouble
Real (decimal) numbers
mtLong
Integer numbers
mtNone
The variable does not store data
mtText
Text variable
mtObject
BLOB data, such as images of scribbled responses and voice recordings
mtBoolean
Boolean variable
5 Set the variable's MinValue and MaxValue properties. The following table describes how MinValue and MaxValue work for the main variable types.
Data type
MinValue
MaxValue
mtCategorical
Specifies the minimum number of responses that must be selected. A value of 1 indicates that at least one response must be selected. A value of 0 indicates that the respondent does not have to select a response.
A value of 1 indicates that this is a single response question. A value greater than 1 indicates that this is a multiple response question. For a multiple response question, MaxValue should indicate the maximum number of responses a respondent can choose. This is typically, but not always, the number of responses in the question.
mtDouble
Indicates the lowest valid value.
Indicates the highest valid value.
mtLong
Indicates the lowest valid value.
Indicates the highest valid value.
mtNone
You do not need to specify MinValue because the variable will not store data.
You do not need to specify MaxValue because the variable will not store data.
mtText
Specifies the minimum number of characters allowed.
Specifies the maximum number of characters allowed.
6 For categorical variables, you need to set up elements for each category. For more information, see Setting up elements.
7 If you want to add categories to other types of variables (for example, to store coded responses, or to represent Don't Know or Refused to Answer categories), you must create them as separate categorical variables, which you then add to the variable's HelperFields collection. For more information, see Setting up helper fields.
See also
Setting up the Document
Setting up elements
Setting up helper fields
Setting up shared category lists
Setting up complex questions
Setting up the routing
Setting up custom properties
Versions
Using the Alias Map component
Visual C++ examples
Populating the MDM Document