__construct()
activate_survey()
activate_tokens()
add_group()
add_language()
add_participants()
add_response()
add_survey()
delete_group()
delete_language()
delete_participants()
delete_question()
delete_survey()
export_responses()
export_statistics()
get_group_properties()
get_language_properties()
get_participant_properties()
get_question_properties()
get_session_key()
get_site_settings()
get_summary()
get_survey_properties()
import_group()
import_question()
import_survey()
invite_participants()
list_groups()
list_participants()
list_questions()
list_surveys()
release_session_key()
remind_participants()
set_group_properties()
set_language_properties()
set_participant_properties()
set_question_properties()
set_survey_properties()
_checkSessionKey()
_doLogin()
_jumpStartSession()
$controller
Surveys
Survey language settings
Groups
Questions
Tokens
This class handles all methods of the RPCs
__construct(\AdminController $controller) : void
access | public |
---|
\AdminController
activate_survey(string $sSessionKey, int $iSurveyID) : array
access | public |
---|
string
Auth credentials
int
The id of the survey to be activated
array
The result of the activationactivate_tokens(string $sSessionKey, integer $iSurveyID, array $aAttributeFields) : array
access | public |
---|
string
Auth credentials
integer
ID of the survey where a token table will be created for
array
An array of integer describing any additional attribute fields
array
Status=>OK when successfull, otherwise the error descriptionadd_group(string $sSessionKey, int $iSurveyID, string $sGroupTitle, string $sGroupDescription) : string
Used as a placeholder for importing questions. Returns the groupid of the created group.
access | public |
---|
string
Auth credentials
int
Dd of the Survey to add the group
string
Name of the group
string
Optional description of the group
string
The id of the new groupadd_language(string $sSessionKey, integer $iSurveyID, string $sLanguage) : array
access | public |
---|
string
Auth credentials
integer
ID of the survey where a token table will be created for
string
A valid language shortcut to add to the current survey. If the language already exists no error will be given.
array
Status=>OK when successfull, otherwise the error descriptionadd_participants(string $sSessionKey, int $iSurveyID, \struct $aParticipantData, bool $bCreateToken) : array
Returns the inserted data including additional new information like the Token entry ID and the token string.
access | public |
---|
string
Auth credentials
int
Id of the Survey
\struct
Data of the participants to be added
bool
Optional - Defaults to true and determins if the access token automatically created
array
The values addedadd_response(string $sSessionKey, int $iSurveyID, \struct $aResponseData) : int
Returns the id of the inserted survey response
access | public |
---|
string
Auth credentials
int
Id of the Survey to insert responses
\struct
The actual response
int
The response IDadd_survey(string $sSessionKey, int $iSurveyID, string $sSurveyTitle, string $sSurveyLanguage, string $sformat) : string
Used as a placeholder for importing groups and/or questions.
access | public |
---|
string
Auth credentials
int
The wish id of the Survey to add
string
Title of the new Survey
string
Default language of the Survey
string
Question appearance format
string
delete_group(string $sSessionKey, int $iSurveyID, int $iGroupID) : int
Returns the id of the deleted group.
access | public |
---|
string
Auth credentials
int
Id of the survey that the group belongs
int
Id of the group to delete
int
The id of the deleted groupdelete_language(string $sSessionKey, integer $iSurveyID, string $sLanguage) : array
access | public |
---|
string
Auth credentials
integer
ID of the survey where a token table will be created for
string
A valid language shortcut to delete from the current survey. If the language does not exist in that survey no error will be given.
array
Status=>OK when successfull, otherwise the error descriptiondelete_participants(string $sSessionKey, int $iSurveyID, array $aTokenIDs) : array
Returns the id of the deleted token
access | public |
---|
string
Auth credentials
int
Id of the Survey that the participants belong to
array
Id of the tokens/participants to delete
array
Result of deletiondelete_question(string $sSessionKey, int $iQuestionID) : string
Returns the id of the deleted question.
access | public |
---|
string
Auth credentials
int
iQuestionID Id of the question to delete
string
Id of the deleted Questiondelete_survey(string $sSessionKey, int $iSurveyID) : array
access | public |
---|
string
Auth credentials
int
The id of the Survey to be deleted
array
Returns Statusexport_responses(string $sSessionKey, int $iSurveyID, string $sDocumentType, string $sLanguageCode, string $sCompletionStatus, string $sHeadingType, string $sResponseType, integer $iFromResponseID, integer $iToResponseID, array $aFields) : array
Returns the requested file as base64 encoded string
access | public |
---|
string
Auth credentials
int
Id of the Survey
string
pdf,csv,xls,doc
string
The language to be used
string
Optional 'complete','incomplete' or 'all' - defaults to complete
string
'code','full' or 'abbreviated' Optional defaults to 'code'
string
'short' or 'long' Optional defaults to 'short'
integer
Optional
integer
Optional
array
Optional Selected fields
array
On success: Requested file as base 64-encoded string. On failure array with error informationexport_statistics(string $sSessionKey, int $iSurveyID, string $docType, $sLanguage, string $graph) : string
Returns string - base64 encoding of the statistics.
access | public |
---|
string
Auth credentials
int
Id of the Survey
string
Type of documents the exported statistics should be $param string $sLanguage Optional language of the survey to use
string
Create graph option
string
Base64 encoded string with the statistics fileget_group_properties(string $sSessionKey, int $iGroupID, array $aGroupSettings) : array
Returns array of properties
access | public |
---|
string
Auth credentials
int
Id of the group to get properties
array
The properties to get
array
The requested valuesget_language_properties(string $sSessionKey, int $iSurveyID, array $aSurveyLocaleSettings, string $sLang) : array
access | public |
---|
string
Auth credentials
int
Dd of the Survey
array
Properties to get
string
Language to use
array
The requested valuesget_participant_properties(string $sSessionKey, int $iSurveyID, int $iTokenID, array $aTokenProperties) : array
access | public |
---|
string
Auth credentials
int
Id of the Survey to get token properties
int
Id of the participant to check
array
The properties to get
array
The requested valuesget_question_properties(string $sSessionKey, int $iQuestionID, array $aQuestionSettings, string $sLanguage) : array
Returns string
access | public |
---|
string
Auth credentials
int
Id of the question to get properties
array
The properties to get
string
Optional parameter language for multilingual questions
array
The requested valuesget_session_key(string $username, string $password) : string
access | public |
---|
string
string
string
get_site_settings(string $sSessionKey, string $sSetttingName) : string
access | public |
---|
string
Auth Credentials
string
Name of the setting to get
string
The requested valueget_summary(string $sSessionKey, int $iSurveyID, string $sStatName) : string
Returns the requested value as string.
access | public |
---|
string
Auth credentials
int
Id of the Survey to get summary
string
Name of the sumamry option
string
The requested valueget_survey_properties(string $sSessionKey, int $iSurveyID, array $aSurveySettings) : array
access | public |
---|
string
Auth credentials
int
The id of the Survey to be checked
array
The properties to get
array
import_group(string $sSessionKey, int $iSurveyID, string $sImportData, string $sImportDataType, string $sNewGroupName, string $sNewGroupDescription) : integer
access | public |
---|
string
Auth credentials
int
The id of the survey that the group will belong
string
String containing the BASE 64 encoded data of a lsg,csv
string
lsg,csv
string
Optional new name for the group
string
Optional new description for the group
integer
iGroupID - ID of the new groupimport_question(string $sSessionKey, int $iSurveyID, int $iGroupID, string $sImportData, string $sImportDataType, string $sMandatory, string $sNewQuestionTitle, string $sNewqQuestion, string $sNewQuestionHelp) : integer
access | public |
---|
string
int
The id of the survey that the question will belong
int
The id of the group that the question will belong
string
String containing the BASE 64 encoded data of a lsg,csv
string
lsq,csv
string
Optional Mandatory question option (default to N)
string
Optional new title for the question
string
An optional new question
string
An optional new question help text
integer
iQuestionID - ID of the new questionimport_survey(string $sSessionKey, string $sImportData, string $sImportDataType, string $sNewSurveyName, integer $DestSurveyID) : integer
access | public |
---|
string
Auth Credentials
string
String containing the BASE 64 encoded data of a lss,csv,xls or survey zip archive
string
lss,csv,xls or zip
string
The optional new name of the survey
integer
This is the new ID of the survey - if already used a random one will be taken instead
integer
iSurveyID - ID of the new surveyinvite_participants(string $sSessionKey, int $iSurveyID) : array
access | public |
---|
string
Auth credentials
int
ID of the survey that participants belong
array
Result of the actionlist_groups(string $sSessionKey, int $iSurveyID) : array
Returns array of ids and info.
access | public |
---|
string
Auth credentials
int
Id of the Survey containing the groups
array
The list of groupslist_participants(string $sSessionKey, int $iSurveyID, int $iStart, int $iLimit, bool $bUnused) : array
if $bUnused is true, user will get the list of not completed tokens (token_return functionality). Parameters iStart and ilimit are used to limit the number of results of this call.
access | public |
---|
string
Auth credentials
int
Id of the survey to list participants
int
Start id of the token list
int
Number of participants to return
bool
If you want unused tokensm, set true
array
The list of tokenslist_questions(string $sSessionKey, int $iSurveyID, int $iGroupID, string $sLanguage) : array
Returns array of ids and info.
access | public |
---|
string
Auth credentials
int
Id of the survey to list questions
int
Optional id of the group to list questions
string
Optional parameter language for multilingual questions
array
The list of questionslist_surveys(string $sSessionKey, string $sUser) : array
Returns array of ids and info. If user is admin he can get surveys of every user (parameter sUser) or all surveys (sUser=null) Else only the syrveys belonging to the user requesting will be shown.
access | public |
---|
string
Auth credentials
string
Optional username to get list of surveys
array
The list of surveysrelease_session_key(string $sSessionKey) : string
access | public |
---|
string
string
remind_participants(string $sSessionKey, int $iSurveyID, int $iMinDaysBetween, int $iMaxReminders) : array
access | public |
---|
string
Auth credentials
int
ID of the survey that participants belong
int
Optional parameter days from last reminder
int
Optional parameter Maximum reminders count
array
Result of the actionset_group_properties(string $sSessionKey, integer $iGroupID, array | \struct $aGroupData) : array
access | public |
---|
string
Auth credentials
integer
array\struct
array
Of succeeded and failed modifications according to internal validation.set_language_properties(string $sSessionKey, integer $iSurveyID, array | \struct $aSurveyLocaleData, string $sLanguage) : array
access | public |
---|
string
Auth credentials
integer
array\struct
string
array
Status=>OK, when save successful otherwise error text.set_participant_properties(string $sSessionKey, int $iSurveyID, int $iTokenID, array | \struct $aTokenData) : array
Returns array
access | public |
---|
string
Auth credentials
int
Id of the survey that participants belong
int
Id of the participant to alter
array\struct
Data to change
array
Result of the change actionset_question_properties(string $sSessionKey, integer $iQuestionID, array | \struct $aQuestionData, string $sLanguage) : array
access | public |
---|
string
Auth credentials
integer
array\struct
string
Optional parameter language for multilingual questions
array
Of succeeded and failed modifications according to internal validation.set_survey_properties(string $sSessionKey, integer $iSurveyID, array | \struct $aSurveyData) : array
access | public |
---|
string
Auth credentials
integer
array\struct
array
Of succeeded and failed nodifications according to internal validation._checkSessionKey(string $sSessionKey) : bool
If yes returns true, otherwise false and sends an error message with error code 1
access | protected |
---|
string
Auth credentials
bool
_doLogin(string $sUsername, mixed $sPassword) : bool
access | protected |
---|
string
The username
mixed
The Password
bool
_jumpStartSession(string $username) : bool
access | protected |
---|
string
The username
bool
$controller : \AdminController
Basic model
sid | int | The survey id (primary key) |
owner_id | int | Id of the user that survey belongs to |
admin | int | The administrator of the survey |
active | varchar(Y|N) | Survey is active |
expires | datetime | Date the survey is due to expire |
startdate | datetime | Date the survey is due to start |
adminemail | varchar | Email of the survey's administrator |
anonymized | varchar(Y|N) | Survey has anonymized responses enabled |
faxto | varchar | This field is used to give a fax number on the "printable survey" |
format | varchar(G|S|A) | The way the questions are shown (G-By group, S - By question, A-All) |
savetimings | varchar (Y|N) | Option to save timings of survey completion |
template | varchar | template to use for Survey presentation |
language | varchar | Language code of the surveys's basic language |
additional_languages | varchar | "|" separated value of additional languages codes |
datestamp | varchar(Y|N) | Store date information for survey responses |
usecookie | varchar(Y|N) | Use cookies to prevent repeated participation |
allowregister | varchar(Y|N) | Allow new users to register when using tokens |
allowsave | varchar(Y|N) | Allow surveys to be saverd for future completion |
autonumber_start | int | Change the numbering in the surveys id |
autoredirect | varchar(Y|N) | Automatically load URL when survey complete |
allowprev | varchar(Y|N) | Show [<< Prev] button |
printanswers | varchar(Y|N) | Participants may print answers |
ipaddr | varchar(Y|N) | Save IP address of responses |
refurl | varchar(Y|N) | Save referrer URL of responses |
datecreated | date | Creation time of Survey |
publicstatistics | varchar(Y|N) | Enable the creation of public statistics |
publicgraphs | varchar(Y|N) | Show graphs in public statistic |
listpublic | varchar(Y|N) | Publish to available surveys portal |
htmlemail | varchar(Y|N) | Use HTML format for token emails |
sendconfirmation | varchar(Y|N) | Enable Send confirmation emails |
tokenanswerspersistence | varchar(Y|N) | Enable token-based response persistence |
assessments | varchar(Y|N) | Enable assesment mode |
usecaptcha | varchar(A|B|C|D|X|R|S|N) | Enble use of captcha for public pages |
usetokens | varchar(Y|N) | Tokens are used |
bounce_email | varchar | Email for delivery error notification email |
attributedescriptions | text | Attribute description expression |
emailresponseto | text | Send detailed admin notification email to |
emailnotificationto | text | Send basic admin notification email to |
tokenlength | int | Set token length to |
showxquestions | varchar(Y|N) | Show "There are X questions in this survey" |
showgroupinfo | varchar(B|N|D|X) | Show group name and|or description. B-Both, N-Name, D-Description, X-None |
shownoanswer | varchar(Y|N) | When Yes, the No Answer will be displayed as the default option for non-mandatory single-select questions |
showqnumcode | varchar(B|N|C|X) | Show question number and code, B-Both, N-Name, C-Code, X-None |
bouncetime | int | Time to wait for bounce enable |
bounceprocessing | varchar(L|N|G) | Bounce settings to use, N-None, L-Survey settings, G-Global settings |
bounceaccounttype | varchar | Bounce email account type (IMAP|POP) |
bounceaccounthost | varchar | Bounce account host |
bounceaccountpass | varchar | Bounce account password |
bounceaccountencryption | varchar | Bounce account encryption |
bounceaccountuser | varchar | Bounce account username |
showwelcome | varchar(Y|N) | Show welcome screen |
showprogress | varchar(Y|N) | Allow the administrator to turn off the Progress bar |
allowjumps | varchar(Y|N) | When Yes, an index will be displayed on the right side. Users can jump to any section in the survey |
navigationdelay | int | Number of seconds before Previous and Next buttons are enabled |
nokeyboard | varchar(Y|N) | By activating this setting there will be a virtual keyboard available for certain question types |
alloweditaftercompletion | varchar(Y|N) | Allow editing of answers after completion |
googleanalyticsstyle | varchar(0|1|2) | 0-Do not use GA, 1-Use Default, 3-Custom GA code |
googleanalyticsapikey | varchar | API key to allow integration with Google Analytics |
Model regarding language specific survey information
surveyls_survey_id | int | The survey_language settings id |
surveyls_language | varchar | Language key for the survey (primary key with surveyls_survey_id) |
surveyls_title | varchar | Title of the Survey |
surveyls_description | text | Description of the Survey |
surveyls_welcometext | text | Welcome text for the Survey |
surveyls_endtext | text | End text of the Survey |
surveyls_url | varchar | End URL |
surveyls_urldescription | varchar | End URL Description |
surveyls_email_invite_subj | varchar | Subject of invitation email |
surveyls_email_invite | text | Body of invitation email |
surveyls_email_remind_subj | varchar | Subject of reminder email |
surveyls_email_remind | text | Body of reminder email |
surveyls_email_register_subj | varchar | Subject of registretion email |
surveyls_email_register | text | Body of registration email |
surveyls_email_confirm_subj | varchar | Subject of confirmation email |
surveyls_email_confirm | text | Body of confirmation email |
surveyls_dateformat | int(0-12) | Format of date |
surveyls_attributecaptions | text | Returns the token's captions |
email_admin_notification_subj | varchar | Subject of Admin email notification |
email_admin_notification |
| Body of admin email notification |
email_admin_responses_subj | varchar | Subject of admin response email |
email_admin_responses | t | Body of admin responses email |
surveyls_numberformat | int(0-1) | Decimal mark, 0-".", 1-"," |
Model of question Groups
gid | int | Group id (Primary key with language) |
sid | int | Survey id the group belongs to |
group_name | varchar | Name of the group |
group_order | int | Order that the group should appear (relative to other groups) |
description | text | Group description |
language | varchar | Language of the group |
randomization_group | varchar | Identifier of randomization group |
grelevance | text | Function to declare that the group has dependencies |
Model of Question
qid | int | Question ID (Primary key with language) |
parent_qid | int | Id of the question that this question belongs (if a subquestion) |
sid | int | Id of the Survey this question belongs |
gid | int | Id of the group this question belongs |
type | varchar | Type of the question () |
title | varchar | Title for the question |
question | text | Actual text question |
preg | text | the optional regular expression validation criteria for the question |
help | text | Help text for the question |
other | varchar | It allows you to specify that an "other" option be presented in some of the list question types |
mandatory | Varchar(Y|N) | Question is mandatory |
question_order | int | Order of appearance |
language | varchar | language code of the question |
scale_id | int | 0 or 1, depending upon question type (e.g. array text will have two scales) |
same_default | int | 'Y' for true, in which case any defaultvalue set for primary language applies to other languages |
relevance | text | This is the Boolean equation that specifies the conditions for this question |
Model of participant Tokens
tid | int | Dd of the token (primary key) |
participant_id | varchar | Id from the central participants |
firstname | varchar | Firstname of participant |
lastname | varchar | Lastname of participant |
text | Participants email | |
emailstatus | text | If ok - email is valid |
token | varchar | Token string |
language | varchar | Participants language |
blacklisted | varchar(Y|N) | Whether the participant is blacklisted |
sent | varchar | Invitation is sent (N|Date) |
remindersent | varchar | Reminder is sent(N|Date) |
remindercount | int | Number of reminders sent |
completed | varchar(Y|N) | Is token used |
usesleft | int | Number of uses left for a token |
validfrom | datetime | Tokens start date |
validuntil | datetime | Tokens end date |
mpid | int | Mpid |