Difference between revisions of "QAS getByQuestionnaireResourceId"

From Catglobe Wiki
Jump to: navigation, search
(Tag: visualeditor)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''<span style="color: rgb(51, 51, 153); font-family: &quot;verdana","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman"; mso-bidi-font-family: "times new roman";">
+
{{HelpFiles}}
        QAS_getByQuestionnaireResourceId</span>'''
+
'''QAS_getByQuestionnaireResourceId'''
  
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">Get all answer sheets of a specific  
+
Get all answer sheets of a specific Questionnaire by Questionnaire resource Id.  
        Questionnaire by Questionaire resource Id.</span>
 
  
'''<span style="color: rgb(128, 0, 64); font-family: &quot;arial","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";" />'''
+
'''Syntax'''
  
'''<span style="color: rgb(128, 0, 64); font-family: &quot;arial","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">Syntax</span>'''<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";" />
+
QAS_getByQuestionnaireResourceId(questionnaireResourceId)
 +
 +
'''Arguments'''
  
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">
+
questionnaireResourceId: is a number expression, it is resource id of Questionnaire.
        QAS_getByQuestionnaireResourceId(questionnaireResourceId)</span>
 
  
'''<span style="color: rgb(128, 0, 64); font-family: &quot;arial","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">Arguments</span>'''<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";" />
+
'''Return value'''
  
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">- questionnaireResourceId: is a number
+
<nowiki>Array of answer sheet objects(include Test QASs) {{QAS_1},{QAS_2},{QAS_3},…...)</nowiki>
        expression, it is resource id of Questionnaire.</span>
 
  
'''<span style="color: rgb(128, 0, 64); font-family: &quot;arial","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">Return value</span>'''<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";" />
+
If no answer sheets exists then it will return an empty array.
  
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">This function returns an
+
See [[QAS_new]] to get more understanding of a QAS object and know how to get value of items of a QAS object.  
        '''array of answer sheet objects''' {{QAS_1},{QAS_2},{QAS_3},…...). If no answer
 
        sheets exists then it will return an '''empty array'''.</span>
 
  
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">See '''
+
In later version, return value is array of [[QAS_class]]
        QAS_new()''' to get more understanding of a QAS object and know how to get
 
        value of items of a QAS object.</span>
 
  
'''<span style="color: rgb(128, 0, 64); font-family: &quot;arial","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";" />'''
+
<br> '''Example:<br>'''
 +
<source lang="javascript">
 +
array All_QASs = QAS_getByQuestionnaireResourceId(37244945);
 +
print(All_QASs); 
 +
/*old return: {
 +
{15,90267303,37244945,37244953,False,1,False,{1,1,1,1,0,0,0,1,40},{1,1,1,1,0,0,0,1,40},0b0f4d6f-97de-488c-80d6-5f843363f046,{1,1,1,0,0,0,0,1,40},1,0},
 +
{15,90267304,37244945,37244954,False,1,False,{1,1,1,1,0,0,0,1,40},{1,1,1,1,0,0,0,1,40},ab9826c5-1556-418d-a00e-0a1b20ae41a2,{1,1,1,0,0,0,0,1,40},1,0},
 +
{15,90267305,37244945,37244955,False,1,False,{1,1,1,1,0,0,0,1,40},{1,1,1,1,0,0,0,1,40},c50290a0-fd28-40a2-a112-2249cff6217d,{1,1,1,0,0,0,0,1,40},1,0}
 +
}*/
 +
//new return: {QAS, QAS, QAS}
  
'''<span style="color: rgb(128, 0, 64); font-family: &quot;arial","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">Example:</span>'''<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";" />
+
//old way to get items value of QAS object
 +
array QAS_object = All_QASs[0];
 +
print(QAS_object[QAS_ID]);//90267303
 +
print(QAS_object[QAS_USER_RESOURCE_ID]);//37244953
 +
print(QAS_object[QAS_TEST]);//False
 +
print(QAS_object[QAS_STATUS]);//1
 +
print(QAS_object[QAS_COMPLETED]);//False
 +
print(QAS_object[QAS_STARTDATE]);//{1,1,1,1,0,0,0,1,40}
 +
print(QAS_object[QAS_ENDDATE]);//Result: {1,1,1,1,0,0,0,1,40}
  
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">array All_QASs =
+
//new way to get items value of QAS class
        QAS_getByQuestionnaireResourceId(37244945);</span>
+
QAS qas = All_QASs[0];
 +
print(qas.Id);//90267303
 +
print(qas.UserResourceId);//37244953
 +
print(qas.Test);//False
 +
print(qas.Status);//1
 +
print(qas.Completed);//False
 +
print(qas.StartDate);//{1,1,1,1,0,0,0,1,40}
 +
print(qas.EndDate);//Result:  {1,1,1,1,0,0,0,1,40}
 +
</source>
 +
'''Availability<br>'''Version 5.8.1
  
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">print(All_QASs); <span style="mso-spacerun: yes;">
+
[[Category:Questionnaire_Functions]]
        &nbsp;&nbsp;</span></span>
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";"><span style="mso-spacerun: yes;">&nbsp;</span>// ---- Result: </span>
 
 
 
'''<span style="font-family: &quot;courier new"; font-size: 16pt;">{</span><span style="color: red; font-family: &quot;courier new";">{</span>'''<span style="font-family: &quot;courier new";">15,90267303,37244945,37244953,False,1,False,{1,1,1,1,0,0,0,1,40},{1,1,1,1,0,0,0,1,40},0b0f4d6f-97de-488c-80d6-5f843363f046,{1,1,1,0,0,0,0,1,40},1,0'''<span style="color: red;">}</span>''',<br> '''<span style="color: red;">{</span>'''15,90267304,37244945,37244954,False,1,False,{1,1,1,1,0,0,0,1,40},{1,1,1,1,0,0,0,1,40},ab9826c5-1556-418d-a00e-0a1b20ae41a2,{1,1,1,0,0,0,0,1,40},1,0'''<span style="color: red;">}</span>''',<br> '''<span style="color: red;">{</span>'''15,90267305,37244945,37244955,False,1,False,{1,1,1,1,0,0,0,1,40},{1,1,1,1,0,0,0,1,40},c50290a0-fd28-40a2-a112-2249cff6217d,{1,1,1,0,0,0,0,1,40},1,0'''<span style="color: red;">}</span>'''</span>'''<span style="font-family: &quot;courier new"; font-size: 16pt;">}</span>'''<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";" />
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">array QAS_object = All_QASs[0];</span>
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">print(QAS_object[QAS_ID]);<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>// --- Result:<span style="mso-spacerun: yes;">&nbsp;
 
        </span>90267303<span style="mso-spacerun: yes;">&nbsp; </span></span>
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">print(QAS_object[QAS_USER_RESOURCE_ID]);
 
        <span style="mso-spacerun: yes;">&nbsp;&nbsp;</span>// --- Result:<span style="mso-spacerun: yes;">&nbsp; </span>37244953</span>
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">print(QAS_object[QAS_TEST]);<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>// --- Result:<span style="mso-spacerun: yes;">&nbsp; </span> False</span>
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">print(QAS_object[QAS_STATUS]);<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>// --- Result:<span style="mso-spacerun: yes;">&nbsp; </span>1</span>
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">print(QAS_object[QAS_COMPLETED]);<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>// --- Result:<span style="mso-spacerun: yes;">&nbsp; </span>False</span>
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">print(QAS_object[QAS_STARTDATE]);<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</span>// --- Result:<span style="mso-spacerun: yes;">&nbsp; </span>{1,1,1,1,0,0,0,1,40}</span>
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">print(QAS_object[QAS_ENDDATE]);<span style="mso-spacerun: yes;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
        &nbsp;&nbsp;&nbsp;</span>// --- Result:<span style="mso-spacerun: yes;">&nbsp; </span> {1,1,1,1,0,0,0,1,40}</span>
 
 
 
'''&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'''
 
 
 
'''<span style="color: rgb(128, 0, 64); font-family: &quot;arial","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">Availability</span>'''<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";" />
 
 
 
<span style="color: black; font-family: &quot;tahoma","sans-serif"; font-size: 10pt; mso-fareast-font-family: "times new roman";">Version 5.8.1</span>
 

Latest revision as of 10:28, 7 August 2019

QAS_getByQuestionnaireResourceId

Get all answer sheets of a specific Questionnaire by Questionnaire resource Id.

Syntax

QAS_getByQuestionnaireResourceId(questionnaireResourceId)

Arguments

questionnaireResourceId: is a number expression, it is resource id of Questionnaire.

Return value

Array of answer sheet objects(include Test QASs) {{QAS_1},{QAS_2},{QAS_3},…...)

If no answer sheets exists then it will return an empty array.

See QAS_new to get more understanding of a QAS object and know how to get value of items of a QAS object.

In later version, return value is array of QAS_class


Example:

array All_QASs = QAS_getByQuestionnaireResourceId(37244945);
print(All_QASs);  
/*old return: {
{15,90267303,37244945,37244953,False,1,False,{1,1,1,1,0,0,0,1,40},{1,1,1,1,0,0,0,1,40},0b0f4d6f-97de-488c-80d6-5f843363f046,{1,1,1,0,0,0,0,1,40},1,0},
 {15,90267304,37244945,37244954,False,1,False,{1,1,1,1,0,0,0,1,40},{1,1,1,1,0,0,0,1,40},ab9826c5-1556-418d-a00e-0a1b20ae41a2,{1,1,1,0,0,0,0,1,40},1,0},
 {15,90267305,37244945,37244955,False,1,False,{1,1,1,1,0,0,0,1,40},{1,1,1,1,0,0,0,1,40},c50290a0-fd28-40a2-a112-2249cff6217d,{1,1,1,0,0,0,0,1,40},1,0}
}*/
//new return: {QAS, QAS, QAS}

//old way to get items value of QAS object
array QAS_object = All_QASs[0];
print(QAS_object[QAS_ID]);//90267303 
print(QAS_object[QAS_USER_RESOURCE_ID]);//37244953
print(QAS_object[QAS_TEST]);//False
print(QAS_object[QAS_STATUS]);//1
print(QAS_object[QAS_COMPLETED]);//False
print(QAS_object[QAS_STARTDATE]);//{1,1,1,1,0,0,0,1,40}
print(QAS_object[QAS_ENDDATE]);//Result:  {1,1,1,1,0,0,0,1,40} 

//new way to get items value of QAS class
QAS qas = All_QASs[0];
print(qas.Id);//90267303 
print(qas.UserResourceId);//37244953
print(qas.Test);//False
print(qas.Status);//1
print(qas.Completed);//False
print(qas.StartDate);//{1,1,1,1,0,0,0,1,40}
print(qas.EndDate);//Result:  {1,1,1,1,0,0,0,1,40}

Availability
Version 5.8.1