Difference between revisions of "GroupBuilderUsageVariable class"

From Catglobe Wiki
Jump to: navigation, search
Line 1: Line 1:
 
{{CGscriptClass_Template
 
{{CGscriptClass_Template
|Name=GroupBuilderUsageVariable
+
|Name=<nowiki>GroupBuilderUsageVariable</nowiki>
|Description=Represents a group builder variable for users with questionnaire participation.
+
|Description=<nowiki>Represents a group builder variable for users with questionnaire participation.</nowiki>
 
|Constructors=
 
|Constructors=
{{CGscriptConstructors_Template|Description=Create new variable}}
+
{{CGscriptConstructors_Template|Description=<nowiki>Create new variable</nowiki>}}
 
|Methods=
 
|Methods=
{{CGscriptMethods_Template|ReturnType=Empty|Name=Add|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Add</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=int|Name=questionnaireResourceId|Description=Questionnaire resource id to add|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=includeTestUsers|Description=Include test users|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=includeCompleted|Description=Include completed qas|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=includePartlyCompleted|Description=Include partly completed qas|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=includeNotStarted|Description=Include not started qas|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=includeNotParticipated|Description=Include all those that have not participated}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>questionnaireResourceId</nowiki>|Description=<nowiki>Questionnaire resource id to add</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>includeTestUsers</nowiki>|Description=<nowiki>Include test users</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>includeCompleted</nowiki>|Description=<nowiki>Include completed qas</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>includePartlyCompleted</nowiki>|Description=<nowiki>Include partly completed qas</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>includeNotStarted</nowiki>|Description=<nowiki>Include not started qas</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>includeNotParticipated</nowiki>|Description=<nowiki>Include all those that have not participated</nowiki>}}
|Description=Add a new questionnaire}}
+
|Description=<nowiki>Add a new questionnaire</nowiki>}}
{{CGscriptMethods_Template|ReturnType=int|Name=this[] { get; }|Parameters=
+
{{CGscriptMethods_Template|ReturnType=int|Name=<nowiki>this[] { get; }</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=int|Name=index|Description=Index}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>index</nowiki>|Description=<nowiki>Index</nowiki>}}
|Description=Get questionnaire resource id at index}}
+
|Description=<nowiki>Get questionnaire resource id at index</nowiki>}}
{{CGscriptMethods_Template|ReturnType=bool|Name=Remove|Parameters=
+
{{CGscriptMethods_Template|ReturnType=bool|Name=<nowiki>Remove</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=int|Name=questionnaireResourceId|Description=Questionnaire resource id to remove}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>questionnaireResourceId</nowiki>|Description=<nowiki>Questionnaire resource id to remove</nowiki>}}
|Description=Remove questionnaire. Return true if removed}}
+
|Description=<nowiki>Remove questionnaire. Return true if removed</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
{{CGscriptProperties_Template|ReturnType=bool|Name=AndBetween|HasGetter=1|HasSetter=1|Description=In multiple condition require all or if false any}}
+
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>AndBetween</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>In multiple condition require all or if false any</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=Count|HasGetter=1|Description=Number of specific samples}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Count</nowiki>|HasGetter=1|Description=<nowiki>Number of specific questionnaire</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
+
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
 
}}
 
}}
  

Revision as of 11:18, 20 April 2017

GroupBuilderUsageVariable



Represents a group builder variable for users with questionnaire participation.

Constructors

  • () - Create new variable

Methods

  • Empty Add(int questionnaireResourceId "Questionnaire resource id to add", bool includeTestUsers "Include test users", bool includeCompleted "Include completed qas", bool includePartlyCompleted "Include partly completed qas", bool includeNotStarted "Include not started qas", bool includeNotParticipated "Include all those that have not participated") - Add a new questionnaire
  • int this[] { get; }(int index "Index") - Get questionnaire resource id at index
  • bool Remove(int questionnaireResourceId "Questionnaire resource id to remove") - Remove questionnaire. Return true if removed
  • string ToString() - The string representation of the object.

Properties

  • bool AndBetween { get; set; } - In multiple condition require all or if false any
  • int Count { get; } - Number of specific questionnaire
  • string ObjectTypeName { get; } - The name of the type of object.
  • TypeInformation TypeInformation { get; } - Get information about this class.


Examples

Example: Add new questionanire

//Create a new group
string groupName = "Test Group Builder: usageVariable";
number groupTemplateResourceId=2066;
number parentResourceId = 11088827;
array group = Group_new(groupName, groupTemplateResourceId, parentResourceId);
Group_save(group);
number groupRId = group[GROUP_RESOURCE_ID ]; 
//Create rule for the group
GroupBuilderRoot root = new GroupBuilderRoot (groupRId);
GroupBuilderUsageVariable usageVariable = new GroupBuilderUsageVariable();
number qnaireRId = 15546533;
bool includeTestUsers =false;
bool includeCompleted = false;
bool includePartlyCompleted = false;
bool includeNotStarted = true;
bool includeNotParticipated = false;
usageVariable.Add(qnaireRId, includeTestUsers, includeCompleted, includePartlyCompleted, includeNotStarted, includeNotParticipated);
usageVariable.Add(15559234, true, true, true, true, false);
usageVariable.AndBetween = false;
GroupBuilderRule rule = new GroupBuilderRule (root);
rule.Add(usageVariable);
GroupBuilderRuleCollection ruleColection = root.RootRules;
ruleColection.Add(rule);
root.Save();


Example: Remmove questionnaire

GroupBuilderRoot root = new GroupBuilderRoot (15560809);
GroupBuilderRuleCollection ruleColection = root.RootRules;
GroupBuilderUsageVariable usageVariable = ruleColection[0][0];
number questionnaireResourceId = usageVariable[0];
usageVariable.Remove(questionnaireResourceId);
root.Save();