Difference between revisions of "QAS getByUserResourceId"

From Catglobe Wiki
Jump to: navigation, search
(jrfconvert import)
 
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:HelpBooks]]
+
{{HelpFiles}}

 
  
====QAS_getByUserResourceId====
+
= QAS_getByUserResourceId =
  
Get list of answer sheets for a user.
+
Get list of answer sheets for a user.  
  
'''Syntax'''
+
'''Syntax'''  
  
QAS_getByUserResourceId(userResourceId[, questionnaireResourceId])
+
* QAS_getByUserResourceId(int userResourceId) - Get a list of qas by the specified user for all questionnaires. Ordered by Created date, latest first.
  
'''Arguments'''
+
* QAS_getByUserResourceId(int userResourceId, int questionnaireResourceId) - Get a list of qas by the specified user and questionnaire. Ordered by Created date, latest first.
  
- userResourceId: is a number expression. It is the user's resource id.
+
* 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
  
- questionnaireResourceId: is a number expression. It is the questionnaire's resource id (optional).
+
* 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.
  
'''Return value'''
+
* QAS_getByUserResourceId(int userResourceId, Array questionnaireResourceIds) - Get a list of qas by the specified user for all questionnaires. Ordered by Created date, latest first.
  
<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>
+
'''Note:'''
 +
userResourceId:
 +
* 0 is use current user
 +
* -1 to force no user
 +
* -2 to anonymous user
  
'''Example:'''
+
'''Return value'''  
  
ex1: QAS_getByUserResourceId(38588899);
+
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.
  
ex2: QAS_getByUserResourceId(38588899,38606878);
+
'''Example:'''
  
'''Availability'''
+
ex1 :
 +
<source lang="javascript">
 +
array qas_list = QAS_getByUserResourceId(38588899);
 +
print(qas_list);
 +
</source>
 +
ex2:
 +
<source lang="javascript">
 +
array qas_list = QAS_getByUserResourceId(38588899,38606878);
 +
print(qas_list);
 +
</source>
  
Version 5.8.1
+
[[Category:Questionnaire_Functions]]
__NOTOC__
 
<!-- imported from file: 8062.htm-->
 

Latest revision as of 07: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);