Difference between revisions of "QAS getCallStack"
Nguyenduyan (talk | contribs) (→QAS_getCallStack) |
|||
(19 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
==== QAS_getCallStack ==== | ==== QAS_getCallStack ==== | ||
− | This function | + | This function to get the call stack for the answer sheet context through a dummy question CG Script. That mean we can know the past and current location of a respondent who is filling out a survey using multiple questionnaires where jumps are performed using either gotoQuestion or gotoQuestionnaire |
'''Syntax''' | '''Syntax''' | ||
Line 13: | Line 13: | ||
'''Return type''' | '''Return type''' | ||
− | array | + | array. The array returned from QAS_getCallStack has the following structure: |
{| cellspacing="0" cellpadding="2" border="1" width="875" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic" | {| cellspacing="0" cellpadding="2" border="1" width="875" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic" | ||
Line 26: | Line 26: | ||
'''Data type''' | '''Data type''' | ||
− | | bgcolor="#C0C0C0" width=" | + | | bgcolor="#C0C0C0" width="1500" style="border:1px solid #010101;" | |
'''Description''' | '''Description''' | ||
Line 39: | Line 39: | ||
<span class="normalise">number</span> | <span class="normalise">number</span> | ||
− | | width=" | + | | width="1500" style="border:1px solid #010101;" | |
<span class="normalise">The answer sheet id for the initial answer sheet, this id is also known as the answer sheet context id.</span> | <span class="normalise">The answer sheet id for the initial answer sheet, this id is also known as the answer sheet context id.</span> | ||
Line 52: | Line 52: | ||
<span class="normalise">array</span> | <span class="normalise">array</span> | ||
− | | width=" | + | | width="1500" style="border:1px solid #010101;" | |
<span class="normalise">All the answer sheet ids currently on the answer sheet call stack, where the first answer sheet id in the array correspond to the caller answer sheet at the bottom of the call stack. | <span class="normalise">All the answer sheet ids currently on the answer sheet call stack, where the first answer sheet id in the array correspond to the caller answer sheet at the bottom of the call stack. | ||
Line 67: | Line 67: | ||
<span class="normalise">array</span> | <span class="normalise">array</span> | ||
− | | width=" | + | | width="1500" style="border:1px solid #010101;" | |
<span class="normalise">This array contains an array for each stack frame on the call stack, including information about caller and callee, where the stack frame in the array correspond to the stack frame at the bottom of the call stack.</span> | <span class="normalise">This array contains an array for each stack frame on the call stack, including information about caller and callee, where the stack frame in the array correspond to the stack frame at the bottom of the call stack.</span> | ||
+ | |} | ||
+ | |||
+ | The property QAS_CALL_STACK_FRAMES consists of arrays which we refer to as call stack frames, each call stack frame consists of two arrays; one for the caller and one for the callee in the following way: | ||
+ | |||
+ | {| cellspacing="0" cellpadding="2" border="1" width="875" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic" | ||
+ | |- align="left" valign="top" | ||
+ | | bgcolor="#C0C0C0" width="200" style="border:1px solid #010101;" | | ||
+ | '''Index''' | ||
+ | |||
+ | | bgcolor="#C0C0C0" width="450" style="border:1px solid #010101;" | | ||
+ | '''Property name''' | ||
+ | |||
+ | | bgcolor="#C0C0C0" width="200" style="border:1px solid #010101;" | | ||
+ | '''Data type''' | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">0</span> | ||
+ | |||
+ | | width="450" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">QAS_STACK_FRAME_CALLER</span> | ||
+ | |||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">array</span> | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">1</span> | ||
+ | | width="450" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">QAS_STACK_FRAME_CALLEE</span> | ||
+ | |||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">array</span> | ||
|} | |} | ||
− | ''' | + | And caller and callee each points to an array of the following structure: |
+ | |||
+ | {| cellspacing="0" cellpadding="2" border="1" width="875" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic" | ||
+ | |- align="left" valign="top" | ||
+ | | bgcolor="#C0C0C0" width="200" style="border:1px solid #010101;" | | ||
+ | '''Index''' | ||
+ | |||
+ | | bgcolor="#C0C0C0" width="450" style="border:1px solid #010101;" | | ||
+ | '''Property name''' | ||
+ | |||
+ | | bgcolor="#C0C0C0" width="200" style="border:1px solid #010101;" | | ||
+ | '''Data type''' | ||
+ | |||
+ | | bgcolor="#C0C0C0" width="1500" style="border:1px solid #010101;" | | ||
+ | '''Description''' | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">0</span> | ||
+ | |||
+ | | width="450" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">QAS_STACK_FRAME_QUESTIONNAIRE_RESOURCE_ID</span> | ||
+ | |||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">number</span> | ||
+ | |||
+ | | width="1500" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">This is the questionnaire resource id for the caller or callee depending on which part this array exists in.</span> | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">1</span> | ||
+ | |||
+ | | width="450" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">QAS_STACK_FRAME_ANSWER_SHEET_ID</span> | ||
+ | |||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">number</span> | ||
+ | |||
+ | | width="1500" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">This is the answer sheet id for the caller or callee depending on which part this array exists in.</span> | ||
+ | |||
+ | |- align="left" valign="top" | ||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">2</span> | ||
+ | |||
+ | | width="450" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">QAS_STACK_FRAME_QUESTION_LABEL</span> | ||
+ | |||
+ | | width="200" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">number</span> | ||
+ | | width="1500" style="border:1px solid #010101;" | | ||
+ | <span class="normalise">This is the question label for the caller or callee depending on which part this array exists in.</span> | ||
− | + | |} | |
+ | '''Example''' | ||
+ | There are 3 questionnaires jumping from A(6432)--> B(6433)--> C(6458). Users put the following CGS in a dummy question | ||
+ | <source lang="csharp"> | ||
+ | array a=QAS_getCallStack(); | ||
+ | //returned an answer sheet call stack with 2 stack frames | ||
+ | //{90462158,{90462158,90462159,90462160},{{{6432,90462158,D_returnBack},{6433,90462159,Q1}},{{6433,90462159,D_returnBack},{6458,90462160,Q1}}}} | ||
+ | </source> | ||
+ | |||
'''Availability''' | '''Availability''' | ||
Latest revision as of 09:57, 3 January 2019
QAS_getCallStack
This function to get the call stack for the answer sheet context through a dummy question CG Script. That mean we can know the past and current location of a respondent who is filling out a survey using multiple questionnaires where jumps are performed using either gotoQuestion or gotoQuestionnaire
Syntax
QAS_getCallStack()
Arguments
No
Return type
array. The array returned from QAS_getCallStack has the following structure:
Index |
Property name |
Data type |
Description |
0 |
QAS_CALL_STACK_ANSWER_SHEET_CONTEXT_ID |
number |
The answer sheet id for the initial answer sheet, this id is also known as the answer sheet context id. |
1 |
QAS_CALL_STACK_ANSWER_SHEET_IDS |
array |
All the answer sheet ids currently on the answer sheet call stack, where the first answer sheet id in the array correspond to the caller answer sheet at the bottom of the call stack. This array always contains minimum one element, which is the initial answer sheet id. |
2 |
QAS_CALL_STACK_FRAMES |
array |
This array contains an array for each stack frame on the call stack, including information about caller and callee, where the stack frame in the array correspond to the stack frame at the bottom of the call stack. |
The property QAS_CALL_STACK_FRAMES consists of arrays which we refer to as call stack frames, each call stack frame consists of two arrays; one for the caller and one for the callee in the following way:
Index |
Property name |
Data type |
0 |
QAS_STACK_FRAME_CALLER |
array |
1 |
QAS_STACK_FRAME_CALLEE |
array |
And caller and callee each points to an array of the following structure:
Index |
Property name |
Data type |
Description |
0 |
QAS_STACK_FRAME_QUESTIONNAIRE_RESOURCE_ID |
number |
This is the questionnaire resource id for the caller or callee depending on which part this array exists in. |
1 |
QAS_STACK_FRAME_ANSWER_SHEET_ID |
number |
This is the answer sheet id for the caller or callee depending on which part this array exists in. |
2 |
QAS_STACK_FRAME_QUESTION_LABEL |
number |
This is the question label for the caller or callee depending on which part this array exists in. |
Example
There are 3 questionnaires jumping from A(6432)--> B(6433)--> C(6458). Users put the following CGS in a dummy question
array a=QAS_getCallStack();
//returned an answer sheet call stack with 2 stack frames
//{90462158,{90462158,90462159,90462160},{{{6432,90462158,D_returnBack},{6433,90462159,Q1}},{{6433,90462159,D_returnBack},{6458,90462160,Q1}}}}
Availability
Version 5.9.5