GroupBuilderUsageVariable class

From Catglobe Wiki
Jump to: navigation, search

GroupBuilderUsageVariable


Represents a group builder variable for users with questionnaire participation.

Parent class

Inherits from GroupBuilderVariable

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
  • object 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
  • (From object) 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.
  • (From 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();