Difference between revisions of "QAS getByUserResourceId"

From Catglobe Wiki
Jump to: navigation, search
(QAS_getByUserResourceId)
Line 7: Line 7:
 
'''Syntax'''  
 
'''Syntax'''  
  
QAS_getByUserResourceId(userResourceId[, questionnaireResourceId])
+
* Array of QAS QAS_getByUserResourceId(int userResourceId "User resource id. 0 to use current.") - Get a list of qas by the specified user for all questionnaires. Ordered by Created date, latest first.
  
'''Arguments'''
+
* Array of QAS QAS_getByUserResourceId(int userResourceId "User resource id. 0 to use current.", Array of int questionnaireResourceIds "Limit list to these questionnaires") - Get a list of qas by the specified user for all questionnaires. Ordered by Created date, latest first.
  
- userResourceId: is a number expression. It is the user's resource id.  
+
* 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. Ordered by Created date, latest first.
  
- questionnaireResourceId: is a number expression. It is the questionnaire's resource id (optional).  
+
* 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. Ordered by Created date, latest first.
 +
 
 +
* 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", bool setTestIfCreate "If creating new, set as test") - Get a list of qas by the specified user and
 +
questionnaire. Ordered by Created date, latest first.
 +
 
 +
* Array of QAS QAS_getByUserResourceIds(Array of int userResourceIds "List of user resource id", int questionnaireResourceId "Questionnaire resource id") - Get a list of qas by the specified users and questionnaire. Ordered by Created date, latest first.
 +
 
 +
 
 +
'''Note:'''
 +
userResourceId:
 +
* 0 is use current user
 +
* -1 to force no user
 +
* -2 to anonymous user
  
 
'''Return value'''  
 
'''Return value'''  

Revision as of 05:29, 20 July 2020



QAS_getByUserResourceId

Get list of answer sheets for a user.

Syntax

  • Array of QAS QAS_getByUserResourceId(int userResourceId "User resource id. 0 to use current.") - Get a list of qas by the specified user for all questionnaires. Ordered by Created date, latest first.
  • Array of QAS QAS_getByUserResourceId(int userResourceId "User resource id. 0 to use current.", Array of int questionnaireResourceIds "Limit list to these questionnaires") - Get a list of qas by the specified user for all questionnaires. Ordered by Created date, latest first.
  • 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. Ordered by Created date, latest first.
  • 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. Ordered by Created date, latest first.
  • 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", bool setTestIfCreate "If creating new, set as test") - Get a list of qas by the specified user and

questionnaire. Ordered by Created date, latest first.

  • Array of QAS QAS_getByUserResourceIds(Array of int userResourceIds "List of user resource id", int questionnaireResourceId "Questionnaire resource id") - Get a list of qas by the specified users and questionnaire. Ordered by Created date, latest first.


Note: userResourceId:

  • 0 is use current user
  • -1 to force no user
  • -2 to anonymous user

Return value

an array of answer sheet objects {{QAS_1},{QAS_2},...} which have been assigned to the specific user. If no answer sheets exists then it will return an empty array.

Example:

ex1 :

array qas_list = QAS_getByUserResourceId(38588899); 
print(qas_list);

ex2:

array qas_list = QAS_getByUserResourceId(38588899,38606878);
print(qas_list);

Availability

Version 5.8.1