Toggle menu
862
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

QAS new: Difference between revisions

From Catglobe Wiki
Dennis (talk | contribs)
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{HelpFiles}}
== QAS_new ==


==== QAS_new ====
Create a new qas


Create a questionnaire answer sheet object
===Syntax===
* QAS_new(int questionnaireResourceId, int userResourceId) - Create new qas.


'''Syntax'''
* QAS_new(int questionnaireResourceId, int userResourceId, bool setTest) - Create new qas.


QAS_new(''questionnaireResourceId, userResourceId'')  
* QAS_new(int questionnaireResourceId) - Create new qas for current user.


or
* QAS_new(int questionnaireResourceId, bool setTest) - Create new qas for current user.


QAS_new(''questionnaireResourceId'')
===Note===


'''Arguments'''
userResourceId:


*''questionnaireResourceId'': is a ''number ''expression. It is the questionnaire's resource id
* 0 is use current user
*''userResourecId'': is a ''number ''expression. It is the user's resource id
* -1 to force no user
* -2 to anonymous uer


'''Return value'''
===Return value===


An array, it is a questionnaire answer sheet object, which contains the following items:  
QAS class, or QAS object which is array contains the following items:  


 
{| class="tableintopic" style="border-collapse:collapse; border:1px solid #010101" width="875" cellspacing="0" cellpadding="2" border="1"
 
|- valign="top" align="left"
{| cellspacing="0" cellpadding="2" border="1" width="875" style="border-collapse:collapse; border:1px solid #010101" class="tableintopic"
| style="border:1px solid #010101;" width="292" bgcolor="#C0C0C0" |  
|- align="left" valign="top"
| bgcolor="#C0C0C0" width="292" style="border:1px solid #010101;" |  
'''Index'''
'''Index'''


| bgcolor="#C0C0C0" width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" bgcolor="#C0C0C0" |  
'''Data type'''
'''Data type'''


| bgcolor="#C0C0C0" width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" bgcolor="#C0C0C0" |  
'''Value'''
'''Value'''


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
<span class="normalise">QAS_ID</span>
<span class="normalise">QAS_ID</span>


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
<span class="normalise">number</span>
<span class="normalise">number</span>


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
<span class="normalise">Primary key</span>
<span class="normalise">Primary key</span>


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
<span class="normalise">QAS_QUESTIONNAIRE_RESOURCE_ID</span>
<span class="normalise">QAS_QUESTIONNAIRE_RESOURCE_ID</span>


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
<span class="normalise">number</span>
<span class="normalise">number</span>


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
<span class="normalise">Questionnaire's resource id</span>
<span class="normalise">Questionnaire's resource id</span>


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
<span class="normalise">QAS_USER_RESOURCE_ID</span>
<span class="normalise">QAS_USER_RESOURCE_ID</span>


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
<span class="normalise">number</span>
<span class="normalise">number</span>


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
<span class="normalise">User's resource id</span>
<span class="normalise">User's resource id</span>


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
<span class="normalise">QAS_TEST</span>
<span class="normalise">QAS_TEST</span>


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
<span class="normalise">bool</span>
<span class="normalise">bool</span>


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
<span class="normalise">If it is a test answer sheet</span>
<span class="normalise">If it is a test answer sheet</span>


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
<span class="normalise">QAS_STATUS</span>
<span class="normalise">QAS_STATUS</span>


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
<span class="normalise">number</span>
<span class="normalise">number</span>


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
<span class="normalise">Questionnaire answer sheet's status, it should be compared to/assigned with defined constants </span>
<span class="normalise">Questionnaire answer sheet's status, it should be compared to/assigned with defined constants </span>


<span class="normalise">(see getRPQStatus function for more information)</span>
<span class="normalise">(see getRPQStatus function for more information)</span>


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
<span class="normalise">QAS_COMPLETED</span>
<span class="normalise">QAS_COMPLETED</span>


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
<span class="normalise">bool</span>
<span class="normalise">bool</span>


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
<span class="normalise">If the answer sheet is completed</span>
<span class="normalise">If the answer sheet is completed</span>


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
<span class="normalise">QAS_STARTDATE</span>
<span class="normalise">QAS_STARTDATE</span>


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
<span class="normalise">array</span>
<span class="normalise">array</span>


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
<span class="normalise">Start date</span>
<span class="normalise">Start date</span>


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
<span class="normalise">QAS_ENDDATE</span>
<span class="normalise">QAS_ENDDATE</span>


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
<span class="normalise">array</span>
<span class="normalise">array</span>


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
<span class="normalise">End date</span>
<span class="normalise">End date</span>


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |
<span class="normalise">QAS_GUID</span>
 
| style="border:1px solid #010101;" width="116" |
<span class="normalise">string</span>
 
| style="border:1px solid #010101;" width="467" |
<span class="normalise">The unique id of qas</span>
 
|- valign="top" align="left"
| style="border:1px solid #010101;" width="292" |  
QAS_CATI_APPOINTMENT
QAS_CATI_APPOINTMENT


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
array
array


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
Next contact datetime
Next contact datetime


|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
QAS_CATI_LIST_TYPE
QAS_CATI_LIST_TYPE


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
number
number


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
1: CATI_MAIN, 2: CATI_ONGOING, 3: CATI_APPOINMENT, 4: CATI_FINISHED, 5: CATI_RETRY
1: CATI_MAIN, 2: CATI_ONGOING, 3: CATI_APPOINMENT, 4: CATI_FINISHED, 5: CATI_RETRY
NOTE! If the QAS is actually part of a CATI run, then this item should only be updated when the value is CATI_FINISHED, or when the CATI is not running, otherwise the CATI system may get confused.
NOTE! If the QAS is actually part of a CATI run, then this item should only be updated when the value is CATI_FINISHED, or when the CATI is not running, otherwise the CATI system may get confused.
|- align="left" valign="top"
|- valign="top" align="left"
| width="292" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="292" |  
QAS_CATI_TIMES_CALLED
QAS_CATI_TIMES_CALLED


| width="116" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="116" |  
number
number


| width="467" style="border:1px solid #010101;" |  
| style="border:1px solid #010101;" width="467" |  
times called
times called
|}
|}


'''Example'''
===Example===
 
<source lang="csharp">
array qas1 = QAS_new(33702597);  
array qas1 = QAS_new(33702597);  
 
qas1[QAS_TEST] = true;
qas1[QAS_TEST] = true;  
 
QAS_save(qas1);  
QAS_save(qas1);  
array qas2 = QAS_new(33702597, 53468);  
array qas2 = QAS_new(33702597, 53468);  
QAS_save(qas2);  
QAS_save(qas2);  
</source>
'''Availability'''


'''Availability'''
Version 5.6


Version 5.6 __NOTOC__ <!-- imported from file: 8060.htm-->  
__FORCETOC__ <!-- imported from file: 8060.htm-->  


[[Category:Questionnaire_Functions]]
[[Category:Questionnaire_Functions]]

Latest revision as of 05:00, 20 July 2020

QAS_new

Create a new qas

Syntax

  • QAS_new(int questionnaireResourceId, int userResourceId) - Create new qas.
  • QAS_new(int questionnaireResourceId, int userResourceId, bool setTest) - Create new qas.
  • QAS_new(int questionnaireResourceId) - Create new qas for current user.
  • QAS_new(int questionnaireResourceId, bool setTest) - Create new qas for current user.

Note

userResourceId:

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

Return value

QAS class, or QAS object which is array contains the following items:

Index

Data type

Value

QAS_ID

number

Primary key

QAS_QUESTIONNAIRE_RESOURCE_ID

number

Questionnaire's resource id

QAS_USER_RESOURCE_ID

number

User's resource id

QAS_TEST

bool

If it is a test answer sheet

QAS_STATUS

number

Questionnaire answer sheet's status, it should be compared to/assigned with defined constants

(see getRPQStatus function for more information)

QAS_COMPLETED

bool

If the answer sheet is completed

QAS_STARTDATE

array

Start date

QAS_ENDDATE

array

End date

QAS_GUID

string

The unique id of qas

QAS_CATI_APPOINTMENT

array

Next contact datetime

QAS_CATI_LIST_TYPE

number

1: CATI_MAIN, 2: CATI_ONGOING, 3: CATI_APPOINMENT, 4: CATI_FINISHED, 5: CATI_RETRY NOTE! If the QAS is actually part of a CATI run, then this item should only be updated when the value is CATI_FINISHED, or when the CATI is not running, otherwise the CATI system may get confused.

QAS_CATI_TIMES_CALLED

number

times called

Example

array qas1 = QAS_new(33702597); 
qas1[QAS_TEST] = true;
QAS_save(qas1); 
array qas2 = QAS_new(33702597, 53468); 
QAS_save(qas2);

Availability

Version 5.6