QAS class

From Catglobe Wiki
Revision as of 07:14, 4 January 2019 by Administrator (talk | contribs) (Created page with "{{CGscriptClass_Template |Name=<nowiki>QAS</nowiki> |Description=<nowiki>Questionnaire answer sheet.</nowiki> |Constructors= {{CGscriptConstructors_Template|Parameters= {{CGsc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

QAS



Questionnaire answer sheet.

Constructors

  • (int qasId "Id of the questionnaire") - Fetch existing qas.
  • (string qasGuid "Id of the questionnaire") - Fetch existing qas.
  • (int QuestionnaireResourceId "Questionnaire resource id", int UserResourceId "User resource id. 0 to use current.") - Create new qas.

Methods

  • bool Any(Function predicate "A function that takes 1 parameter of the types in the array, and return true/false") - Return true if the array contains the element using the given function.
  • bool Contains(object element "Element to check for") - Return true if the array contains the element using the normal equal operator.
  • array Except(array elements "Elements to remove") - Return all elements that does not exist in the other collection.
  • object First(Function selector "A function to test each element for a condition.") - Returns the first element in a sequence that satisfies a specified condition.
  • object FirstOrDefault(Function selector "A function to test each element for a condition.") - Returns the first element in a sequence that satisfies a specified condition or empty if not found.
  • int Frequency(number number "The number to search for") - Counts the number of times a given Number object exists in the Array. Can only use if all the elements are of type Number
  • object this[] { get; }(int index "Index") - Backward-compatible indexer
  • bool IsCharacterArray() - check if array is an array of characters
  • bool IsNumericArray() - check if array is an array of integer numbers
  • bool IsStringArray() - check if array is an array of string
  • array OrderBy(Function comparer "Function that compares two objects of the same type. Must return a signed integer that indicates the relative values of first param A and second param B. Value Less than 0 : A is less than B.Value 0 : A equals B.Value Greater than 0 : A is greater than B.It can also be a function that takes 1 parameter and returns a string or number.") - Sorts the elements of a sequence in ascending order by using a specified comparer.
  • Empty Randomize() - Randomize the order of the elements in the current array.
  • array Reverse() - Returns an array with all the elements in the opposite order.
  • Empty Save() - Save qas.
  • array Select(Function selector "A transform function to apply to each element.") - Projects each element of a sequence into a new form.
  • array SelectMany(Function selector "A transform function to get each sub array.") - Projects each array element of a sequence into a new form.
  • Empty this[] { set; }(int index "Index", object value "Value to set") - Backward-compatible indexer
  • array Skip(int n "How many elements to skip") - Get all but the n first elements.
  • array Take(int n "How many elements to take") - Get the n first elements.
  • Dictionary ToDictionary(Function keySelector "A transform function to get the key of each element.") - Return a dictionary with the elements of the array.
  • Dictionary ToDictionary(Function keySelector "A transform function to get the key of each element.", Function valueSelector "A transform function to get the value of each element.") - Return a dictionary with the elements of the array.
  • string ToString() - The string representation of the object.
  • array Where(Function predicate "A function that takes 1 parameter of the types in the array and return true/false") - Filters a sequence of values based on a predicate.

Properties

  • string AccessCode { get; } - Get the unique access code for use in login or sms-style url.
  • number Average { get; } - Average of the objects in the Array object. Can only use if all the elements are of type Number
  • DateTime CatiCallTime { get; } - If meeting or retry, when will this qas be schedule for.
  • int CatiList { get; } - Which type of cati call. 1 = main, 2 = ongoing, 3 = appointment, 4 = done, 5 = retry.
  • int CatiPriority { get; set; } - Priority of call. Only used on mainlist.
  • bool Completed { get; set; } - Get/set completed. Warning: Quotas will not be updated on save, use setUserProjectQuestionnaireCompleted/setRPQCompleted.
  • DateTime EndDate { get; set; } - When was this qas finished.
  • number Max { get; } - Largest of all the objects in the Array object. Can only use if all the elements are of type Number
  • number Min { get; } - Smallest of all the objects in the Array object. Can only use if all the elements are of type Number
  • string ObjectTypeName { get; } - The name of the type of object.
  • int SampleRuleId { get; } - Id of the sample rule
  • DateTime StartDate { get; set; } - When was this qas started.
  • int Status { get; set; } - Current status of qas. See UserProjectQuestionnaire_Status_xxx/RPQ_Status_xxx.
  • number Sum { get; } - Sum of all the objects in the Array object. Can only use if all the elements are of type Number
  • bool Test { get; set; } - Get/set if test qas.
  • TypeInformation TypeInformation { get; } - Get information about this class.
  • int UserResourceId { get; set; } - Get/set user the qas belongs to. May be 0 for anonymous

Static Methods

  • Array of number QAS_anonymize(Unknown qasIds "List of qas ids") - Delete all user references for the qas and data. Returns list of qas that qas NOT anonymized.
  • string QAS_createUniqueAccessCode(int qasId "Id of the questionnaire") - Return the unique access code for this qas.
  • Array of number QAS_deleteData(Unknown qasIds "List of qas ids") - Delete data for the given qas. Returns list of qas that qas NOT deleted data for.
  • bool QAS_exists(int QuestionnaireResourceId "Questionnaire resource id") - Check if a QAS exists.
  • bool QAS_exists(int QuestionnaireResourceId "Questionnaire resource id", int UserResourceId "User resource id. 0 to use current.") - Check if a QAS exists.
  • object QAS_flushCallStack() - Flush the call stack of current context qas and return what stack was. Only works on subs (called qas) when called from the questionnaire viewer.
  • QAS QAS_getByGuid(string qasGuid "Id of the questionnaire") - Fetch existing qas.
  • Array of QAS QAS_getByQuestionnaireResourceId(int QuestionnaireResourceId "Questionnaire resource id") - Fetch existing qas.
  • QAS QAS_getByUniqueAccessCode(string accessCode "Access code") - Find qas by the access code.
  • Array of QAS QAS_getByUserResourceId(int UserResourceId "User resource id.") - Get a list of qas by the specified user for all questionnaires.
  • Array of QAS QAS_getByUserResourceId(int UserResourceId "User resource id. 0 to use current.", int QuestionnaireResourceId "Questionnaire resource id") - Get a list of qas by the specified user and questionnaire.
  • Array of QAS QAS_getByUserResourceId(int UserResourceId "User resource id. 0 to use current.", int QuestionnaireResourceId "Questionnaire resource id", bool createIfNone "Create a new one if there are none") - Get a list of qas by the specified user and questionnaire.
  • array QAS_getCallStack() - Get the call stack of current context qas. Only works on subs (called qas) when called from the questionnaire viewer.
  • Array of number QAS_getCATIListAppointments() - Return the list of qas that has appointments for the current user for the given questionnaire.
  • Array of number QAS_getCATIListAppointments(int QuestionnaireResourceId "Questionnaire resource id. Use 0 to use context") - Return the list of qas that has appointments for the current user for the given questionnaire.
  • QAS QAS_getCurrentQAS() - Fetch current context qas.
  • Array of number QAS_getIdsByBulkMail(int bulkMailResourceId "Resource id of the bulkmail to get info from", int questionnaireResourceId "Resource id of the questionnaire to get info from", bool getLatest "If true, only fetch those that got the most recent mailout") - Return a list of all qas ids who received a given bulkmail.
  • object QAS_getLastInterviewerId() - Return the user unique id for final interviewer of current context qas.
  • Dictionary QAS_getParameters() - Return the url parameters given in the url that opened the viewer for this qas. Only works when called from viewer.
  • QAS QAS_getQASById(int qasId "Id of the questionnaire") - Fetch existing qas. Returns empty if qas is deleted
  • object QAS_getSampleRuleId() - Return the sample rule id for the current context qas.
  • QAS QAS_new(int QuestionnaireResourceId "Questionnaire resource id", int UserResourceId "User resource id. 0 to use current.") - Create new qas.
  • QAS QAS_new(int QuestionnaireResourceId "Questionnaire resource id") - Create new qas.
  • Array of number QAS_reset(Unknown qasIds "List of qas ids") - Reset RPQ without delete data. Returns list of qas that qas NOT reset.
  • Empty QAS_save(QAS qas "Qas to save") - Fetch current context qas.
  • Array of number QAS_setCompleted(Unknown qasIds "List of qas ids", bool completed "True to set all to completed, false to unset all") - Set or unset completed state of given qas. When completing, EndDate is set to now, and StartDate is also set to now unless it was already set. Returns list of qas that qas NOT deleted data for.