Difference between revisions of "Category:Question conditions"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "Category:Questionnaire template editor  =====Question conditions===== Conditions are the rules that we can define to make questions and navigate the questions depending ...")
 
 
Line 1: Line 1:
[[Category:Questionnaire template editor]]
+
  

 
  
=====Question conditions=====
+
== Question conditions ==
  
Conditions are the rules that we can define to make questions and navigate the questions depending on what respondents have answered in earlier questions or based on the information we already know about them. There are many conditions in the questionnaire.
+
Conditions are the rules that we can define to make questions and navigate the questions depending on what respondents have answered in earlier questions or based on the information we already know about them. There are many conditions in the questionnaire.  
  
An example could be that if we know a respondent who does not drink cola, then there will be no reasons asking him the following question on comparing the taste of this cola with Coca-Cola. Instead, we will go directly to a completely different question.
+
An example could be that if we know a respondent who does not drink cola, then there will be no reasons asking him the following question on comparing the taste of this cola with Coca-Cola. Instead, we will go directly to a completely different question.  
  
==Condition syntax==
+
== Condition syntax ==
  
'''Mathematical symbols: '''
+
'''Mathematical symbols: '''  
  
Conditions use the mathematical symbols below:
+
Conditions use the mathematical symbols below:  
  
[[Image:1771.png|400px|Conditions 1]]
+
[[Image:1771.png|400px|Conditions 1]]  
  
These symbols are explained in the table below:
+
These symbols are explained in the table below:  
  
[[Image:1772.png|600px|Conditions 2]]
+
[[Image:1772.png|600px|Conditions 2]]  
  
'''Expressions:'''
+
'''Expressions:'''  
  
Consist of Variable, Operator and Constant.
+
Consist of Variable, Operator and Constant.  
  
Most expressions have three parts.
+
Most expressions have three parts.  
  
* Variable: the data you are comparing with
+
*Variable: the data you are comparing with  
* Operator: the mathematical symbol used in a comparison
+
*Operator: the mathematical symbol used in a comparison  
* Constant: the element which the variable is being compared with
+
*Constant: the element which the variable is being compared with
  
 
For example:  
 
For example:  
  
''age = = 40 ''
+
''age = = 40 ''  
  
where
+
where  
  
''age'' is the variable
+
''age'' is the variable  
  
''<nowiki>= =</nowiki>'' is the operator
+
''<nowiki>= =</nowiki>'' is the operator  
  
''40'' is the constant.
+
''40'' is the constant.  
  
'''Formats of variables'''
+
'''Formats of variables'''  
  
The formats of the variables are quite simple. It is a label’s name of a question.
+
The formats of the variables are quite simple. It is a label’s name of a question.  
  
[[Image:1773.png|180px|Conditions 3]]
+
[[Image:1773.png|180px|Conditions 3]]  
  
These labels can easily be entered by selecting one from the question drop down list. If you want to point to a sub-question you must put brackets after the question label with the sub-question number in between, e.g. New_2[2].
+
These labels can easily be entered by selecting one from the question drop down list. If you want to point to a sub-question you must put brackets after the question label with the sub-question number in between, e.g. New_2[2].  
  
'''Formats of operators'''
+
'''Formats of operators'''  
  
The syntax will be shown somewhat differently in the forms from the display on the buttons. Since it is also possible to enter syntax directly in the forms, it is important to understand the correct format. All formats of operators are shown below.
+
The syntax will be shown somewhat differently in the forms from the display on the buttons. Since it is also possible to enter syntax directly in the forms, it is important to understand the correct format. All formats of operators are shown below.  
  
[[Image:1774.png|608px|Conditions 4]]
+
[[Image:1774.png|608px|Conditions 4]]  
  
'''Formats of Constants'''
+
'''Formats of Constants'''  
  
When inserting formats of constants (e.g. age == 40 where 40 is the constant), it is important to put the correct syntax around the constant for the expression to understand it.
+
When inserting formats of constants (e.g. age == 40 where 40 is the constant), it is important to put the correct syntax around the constant for the expression to understand it.  
  
When it comes to the answer of a single type question (single and grid-single), you can put the constant in brackets or not:
+
When it comes to the answer of a single type question (single and grid-single), you can put the constant in brackets or not:  
  
For example:
+
For example:  
  
* ''Gender = = [1] or Gender = = 1''
+
*''Gender = = [1] or Gender = = 1''
  
When it comes to the answer of a multi type question (multi and grid-multi) you put the constant in brackets. However, if this constant is a range, put these values in brackets:
+
When it comes to the answer of a multi type question (multi and grid-multi) you put the constant in brackets. However, if this constant is a range, put these values in brackets:  
  
For example:
+
For example:  
  
* ''Hobbies = = [1] ''
+
*''Hobbies = = [1] ''  
* ''Hobbies = = [1-4] ''
+
*''Hobbies = = [1-4] ''
  
 
(meaning Hobbies = = 1 or Hobbies 2 or Hobbies = = 3 or Hobbies = = 4)  
 
(meaning Hobbies = = 1 or Hobbies 2 or Hobbies = = 3 or Hobbies = = 4)  
  
* ''Hobbies = = [1,3-4] ''
+
*''Hobbies = = [1,3-4] ''
  
(meaning Hobbies = = 1 or Hobbies = = 3 or Hobbies = = 4)
+
(meaning Hobbies = = 1 or Hobbies = = 3 or Hobbies = = 4)  
  
When it comes to the answer of a numerical question (number, scale, and grid-scale) you need not change the syntax:
+
When it comes to the answer of a numerical question (number, scale, and grid-scale) you need not change the syntax:  
  
For example:
+
For example:  
  
* ''age = = 40''
+
*''age = = 40''
  
When it comes to the answer of a text question (text, open and grid-text) you must place double quotes around the constant:
+
When it comes to the answer of a text question (text, open and grid-text) you must place double quotes around the constant:
 +
 
 +
For example:  
  
For example:
+
*''name = ="Peter"''
  
* ''name = ="Peter"''
+
The followings are examples of how you can set up ranges.
  
The followings are examples of how you can set up ranges.
+
[[Image:1775.png|666px|Conditions 5]]
  
[[Image:1775.png|666px|Conditions 5]]
+
'''Validate'''
  
'''Validate'''
+
Some conditions give the user a validation function. When he uses this function, it will verify whether the syntax of a condition is valid or not. If this condition syntax is valid, the color of the Validate button which is placed on the right of each condition will turn to green. Otherwise, it will turn to red. __NOTOC__ <!-- imported from file: 1009.htm-->
  
Some conditions give the user a validation function. When he uses this function, it will verify whether the syntax of a condition is valid or not. If this condition syntax is valid, the color of the Validate button which is placed on the right of each condition will turn to green. Otherwise, it will turn to red.
+
[[Category:Questionnaire_template_editor]]
__NOTOC__
 
<!-- imported from file: 1009.htm-->
 

Latest revision as of 05:36, 31 January 2012



Question conditions

Conditions are the rules that we can define to make questions and navigate the questions depending on what respondents have answered in earlier questions or based on the information we already know about them. There are many conditions in the questionnaire.

An example could be that if we know a respondent who does not drink cola, then there will be no reasons asking him the following question on comparing the taste of this cola with Coca-Cola. Instead, we will go directly to a completely different question.

Condition syntax

Mathematical symbols:

Conditions use the mathematical symbols below:

Conditions 1

These symbols are explained in the table below:

Conditions 2

Expressions:

Consist of Variable, Operator and Constant.

Most expressions have three parts.

  • Variable: the data you are comparing with
  • Operator: the mathematical symbol used in a comparison
  • Constant: the element which the variable is being compared with

For example:

age = = 40

where

age is the variable

= = is the operator

40 is the constant.

Formats of variables

The formats of the variables are quite simple. It is a label’s name of a question.

Conditions 3

These labels can easily be entered by selecting one from the question drop down list. If you want to point to a sub-question you must put brackets after the question label with the sub-question number in between, e.g. New_2[2].

Formats of operators

The syntax will be shown somewhat differently in the forms from the display on the buttons. Since it is also possible to enter syntax directly in the forms, it is important to understand the correct format. All formats of operators are shown below.

Conditions 4

Formats of Constants

When inserting formats of constants (e.g. age == 40 where 40 is the constant), it is important to put the correct syntax around the constant for the expression to understand it.

When it comes to the answer of a single type question (single and grid-single), you can put the constant in brackets or not:

For example:

  • Gender = = [1] or Gender = = 1

When it comes to the answer of a multi type question (multi and grid-multi) you put the constant in brackets. However, if this constant is a range, put these values in brackets:

For example:

  • Hobbies = = [1]
  • Hobbies = = [1-4]

(meaning Hobbies = = 1 or Hobbies 2 or Hobbies = = 3 or Hobbies = = 4)

  • Hobbies = = [1,3-4]

(meaning Hobbies = = 1 or Hobbies = = 3 or Hobbies = = 4)

When it comes to the answer of a numerical question (number, scale, and grid-scale) you need not change the syntax:

For example:

  • age = = 40

When it comes to the answer of a text question (text, open and grid-text) you must place double quotes around the constant:

For example:

  • name = ="Peter"

The followings are examples of how you can set up ranges.

Conditions 5

Validate

Some conditions give the user a validation function. When he uses this function, it will verify whether the syntax of a condition is valid or not. If this condition syntax is valid, the color of the Validate button which is placed on the right of each condition will turn to green. Otherwise, it will turn to red.