Difference between revisions of "QAS getByUserResourceId"

From Catglobe Wiki
Jump to: navigation, search
(QAS_getByUserResourceId)
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
'''Syntax'''  
 
'''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.
+
* QAS_getByUserResourceId(int userResourceId) - 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.
+
* QAS_getByUserResourceId(int userResourceId, int questionnaireResourceId) - 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") - Get a list of qas by the specified user and questionnaire. Ordered by Created date, latest first.
+
* QAS_getByUserResourceId(int userResourceId, int questionnaireResourceId, bool createIfNone) - Get a list of qas by the specified user and questionnaire. Ordered by Created date, latest first. Support to create qas if no qas existed, default when not set createIfNone is false
  
* 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.
+
* QAS_getByUserResourceId(int userResourceId, int questionnaireResourceId, bool createIfNone, bool setTestIfCreate) - Get a list of qas by the specified user and questionnaire. Ordered by Created date, latest first. Support to create qas if no qas existed, default when not set createIfNone is false. Can also set test qas if create, default setTestIfCreate is false.
 
 
* 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.
 
  
 +
* QAS_getByUserResourceId(int userResourceId, Array questionnaireResourceIds) - Get a list of qas by the specified user for all questionnaires. Ordered by Created date, latest first.
  
 
'''Note:'''  
 
'''Note:'''  
Line 29: Line 25:
 
'''Return value'''  
 
'''Return value'''  
  
<nowiki>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.</nowiki>
+
Array of [[QAS_class|QAS]] {qas1, qas2,...} which have been assigned to the specific user. If no answer sheets exists then it will return an empty array.
  
 
'''Example:'''  
 
'''Example:'''  
Line 43: Line 39:
 
print(qas_list);
 
print(qas_list);
 
</source>
 
</source>
'''Availability'''
 
 
Version 5.8.1 __NOTOC__
 
  
 
[[Category:Questionnaire_Functions]]
 
[[Category:Questionnaire_Functions]]

Latest revision as of 08:38, 11 August 2020



QAS_getByUserResourceId

Get list of answer sheets for a user.

Syntax

  • QAS_getByUserResourceId(int userResourceId) - Get a list of qas by the specified user for all questionnaires. Ordered by Created date, latest first.
  • QAS_getByUserResourceId(int userResourceId, int questionnaireResourceId) - Get a list of qas by the specified user and questionnaire. Ordered by Created date, latest first.
  • QAS_getByUserResourceId(int userResourceId, int questionnaireResourceId, bool createIfNone) - Get a list of qas by the specified user and questionnaire. Ordered by Created date, latest first. Support to create qas if no qas existed, default when not set createIfNone is false
  • QAS_getByUserResourceId(int userResourceId, int questionnaireResourceId, bool createIfNone, bool setTestIfCreate) - Get a list of qas by the specified user and questionnaire. Ordered by Created date, latest first. Support to create qas if no qas existed, default when not set createIfNone is false. Can also set test qas if create, default setTestIfCreate is false.
  • QAS_getByUserResourceId(int userResourceId, Array questionnaireResourceIds) - Get a list of qas by the specified user for all questionnaires. Ordered by Created date, latest first.

Note: userResourceId:

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

Return value

Array of QAS {qas1, qas2,...} 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);