Class Survey
package | Default |
---|
active(): mixed
mixed
afterFindSurvey()
attributeLabels()
inheritdoc | |
---|---|
behaviors(): array
Below is a list of all behaviors we register:
see | \PluginEventBehavior\CTimestampBehavior |
---|---|
array
calculateEstimatedTime(): double
deprecated | , unused since 3.X Approx is 3 questions each minute. |
---|---|
double
checkExpireAfterStart( $attributes, $params)
decrypt( $value = '')
decryptEncryptAttributes( $action = 'decrypt')
decryptSingle(string $value = ''): string
string
String value which needs to be decrypted
string
the decrypted string
decryptSingleOld(string $value = ''): string
string
String value which needs to be decrypted
string
the decrypted string
delete(boolean $recursive = true)
inheritdoc | With allow to delete all related models and data and test Permission. |
---|---|
boolean
deleteAllByAttributes(array $attributes,string $condition = '',array $params = array()): integer
todo | This should also be moved to the behavior at some point. This method overrides the parent in order to raise PluginEvents for Bulk delete operations. Filter Criteria are wrapped into a CDBCriteria instance so we have a single instance responsible for holding the filter criteria to be passed to the PluginEvent, this also enables us to pass the fully configured CDBCriteria instead of the original Parameters. See {@link find()} for detailed explanation about $condition and $params. |
---|
array
list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.
string
query condition or criteria.
array
parameters to be bound to an SQL statement.
integer
number of rows affected by the execution.
deleteSurvey(integer $iSurveyID,boolean $recursive = true): boolean
access | public |
---|
integer
boolean
boolean
dispatchPluginModelEvent(string $sEventName,\CDbCriteria $criteria = null,array $eventParams = []): \PluginEvent
string
\CDbCriteria
array
\PluginEvent
encrypt()
encryptAttributeValues(array $attributes = null, $bEncryptedOnly = false, $bReplaceValues = true): array
array
list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.
array
attributes array with encrypted atrribute values is returned
encryptSave( $runValidation = false)
encryptSingle(string $value = '')
string
String value which needs to be encrypted
expire(integer $surveyId = null): boolean|null
integer
Survey ID
boolean|null
filterTemplateSave(string $sTemplateName): string
string
string
findAllAsArray(mixed $condition = '',array $params = array()): array
See \find() for detailed explanation about $condition and $params.
mixed
query condition or criteria.
array
parameters to be bound to an SQL statement.
array
list of active records satisfying the specified condition. An empty array is returned if none is found.
findAllByAttributes(array $attributes,mixed $condition = '',array $params = array()): array<mixed,static>
array
list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.
mixed
query condition or criteria.
array
parameters to be bound to an SQL statement.
array<mixed,static>
the records found. An empty array is returned if none is found.
findAllPublic()
findByAttributes(array $attributes,mixed $condition = '',array $params = array()): static|null
array
list of attribute values (indexed by attribute names) that the active record should match. An attribute value can be an array which will be used to generate an IN condition.
mixed
query condition or criteria.
array
parameters to be bound to an SQL statement.
static|null
the record found. Null if none is found.
findByPk( $pk, $condition = '', $params = array())
inheritdoc | . But use a static var because can be used a lot of time. |
---|---|
findQuestionByType(string $type,boolean $includeSubquestions = false): \Question
fixInvalidQuestions()
getActiveWord(): string
string
getAdditionalLanguages(): array
access | public |
---|---|
array
getAliasForLanguage(string|null $language = null): string|null
string|null
string|null
getAllEncryptedAttributes(integer $iSurveyId,string $sClassName): array
integer
string
array
TODO: Should be split into seperate functions in the appropiate model or helper class TODO: Make an interface for records that support encryption.
getAllLanguages(): array
access | public |
---|---|
array
getAnonymizedResponses(): string
string
getCountFullAnswers(): integer|string
integer|string
getCountInputQuestions(): integer
integer
getCountNoInputQuestions(): integer
integer
getCountPartialAnswers(): integer
integer
getCountTotalAnswers(): integer
integer
getCountTotalQuestions(): integer
integer
getCPDBMappings(): array
array
Array of mappings
getCreationDate(): string
string
formatted date
getCurrentLanguageSettings(): \SurveyLanguageSetting
getDateFormatted(string $attribute): string
string
date attribute name
string
formatted date
getDecodedAttributedescriptions(): Array
Array
getExpiryDateFormatted(): string
string
formatted date
getFullAnswers(): array|null
array|null
getGoogleanalyticsapikey(): string
string
getGoogleanalyticsapikeysetting(): string
string
getGroupsCount()
getHasResponsesTable(): boolean
boolean
getHasTimingsTable(): boolean
boolean
getHasTokensTable(): boolean
boolean
getIsActive(): boolean
boolean
getIsAllowEditAfterCompletion(): boolean
boolean
getIsAllowPrev(): boolean
boolean
getIsAllowRegister(): boolean
boolean
getIsAllowSave(): boolean
boolean
getIsAnonymized(): boolean
boolean
getIsAssessments(): boolean
boolean
getIsAutoRedirect(): boolean
boolean
getIsDateExpired(): boolean
Throws |
|
---|
boolean
getIsDateStamp(): boolean
boolean
getIsHtmlEmail(): boolean
boolean
getIsIpAddr(): boolean
boolean
getIsIpAnonymize(): boolean
boolean
getIsListPublic(): boolean
boolean
getIsNoKeyboard(): boolean
boolean
getIsPrintAnswers(): boolean
boolean
getIsPublicGraphs(): boolean
boolean
getIsPublicStatistics(): boolean
boolean
getIsRefUrl(): boolean
boolean
getIsSaveTimings(): boolean
boolean
getIsSendConfirmation(): boolean
boolean
getIsShowGroupInfo(): boolean
boolean
getIsShowNoAnswer(): boolean
boolean
getIsShowProgress(): boolean
boolean
getIsShowQnumCode(): boolean
boolean
getIsShowWelcome(): boolean
boolean
getIsShowXQuestions(): boolean
boolean
getIsTokenAnswersPersistence(): boolean
boolean
getIsUseCookie(): boolean
boolean
getLanguageForSurveyTaking(): string
string
the correct language
getLocalizedTitle()
getMaxId(string $field = null,boolean $forceRefresh = false): false|integer
This is a convenience method, that uses the primary key of the model to retrieve the highest value.
Throws |
|
---|
string
The field that contains the Id, when null primary key is used if it is a single field
boolean
Don't use value from static cache but always requery the database
false|integer
getMinId(string $field = null,boolean $forceRefresh = false): false|integer
This is a convenience method, that uses the primary key of the model to retrieve the highest value.
Throws |
|
---|
string
The field that contains the Id, when null primary key is used if it is a single field
boolean
Don't use value from static cache but always requery the database
false|integer
getMinimalPermissionRead(): null|string
null|string
getOwnerId(): integer|null
integer|null
getOwnerUserName(): string
string
getPartialAnswers(): array|null
array|null
getPermissionCriteria( $userid = null): \CDbCriteria
todo | : move to PermissionInterface : create an event |
---|
for thius user id , if not set : get current one
\CDbCriteria
getPermissionData(): array
array
getQuestionOrderCriteria(): \CDbCriteria
\CDbCriteria
getResponsesTableName(): string
string
getRunning(): string
todo | Document code, please. |
---|---|
string
getsSurveyUrl()
getStartDateFormatted(): string
string
formatted date
getState(): string
Code copied from getRunning below.
string
getSurveyMenus(string $position = ''): array
todo | this function can go directly into Surveymenu, why implemted it here? ($this is used here ...) This will be made bigger in future releases, but right now it only collects the default menu-entries |
---|
string
Position
array
getSurveyQuestionsCriteria()
getSurveysWithTokenTable(): array<mixed,\Survey>
getSurveyTemplateConfiguration(): \TemplateConfiguration
\TemplateConfiguration
getSurveyUrl(string|null $language = null,\array<string,mixed> $params = array(),boolean $preferShortUrl = true): string
If $preferShortUrl is true (default), and an alias is available, it returns the short version of the URL.
string|null
\array
Optional parameters to include in the URL.
boolean
If true, tries to return the short URL instead of the traditional one.
string
getTemplateEffectiveName(): string
It resolves inheritance from group and from default settings.
todo | : Cache this on a private attribute? |
---|---|
string
getTimingsTableName(): string
string
getTokenAttributes(): array
access | public |
---|---|
array
getTokenEncryptionOptions(): Array
Array
getTokensTableName(): string
string
hasPermission(string $sPermission,string $sCRUD = 'read',integer $iUserID = null): boolean
string
Name of the permission
string
The permission detail you want to check on: 'create','read','update','delete','import' or 'export'
integer
User ID - if not given the one of the current user is used
boolean
hasQuestionType(string $type,boolean $includeSubquestions = false): boolean
Throws |
|
---|
string
Question type, like 'L', 'T', etc.
boolean
If true, will also check the types of subquestions.
boolean
init()
inheritdoc | |
---|---|
insertNewSurvey(array $aData): \Survey
model( $className = __CLASS__): \Survey
primaryKey()
inheritdoc | |
---|---|
query(\CDbCriteria $criteria,boolean $all = false,boolean $asAR = true): mixed
Performs the actual DB query and populates the AR objects with the query result. This method is mainly internally used by other AR query methods.
since | 1.1.7 |
---|
\CDbCriteria
the query criteria
boolean
whether to return all data
boolean
mixed
the AR objects populated with the query result
relations()
inheritdoc | |
---|---|
replacePolicyLink(string $dataSecurityNoticeLabel,integer $surveyId): string
string
current label
integer
unused
string
resetCache()
rules()
inheritdoc | |
---|---|
saveTranscribeCaptchaOptions(\Survey $oSurvey = null): string
'A' = All three captcha enabled 'B' = All but save and load 'C' = All but registration 'D' = All but survey access 'X' = Only survey access 'R' = Only registration 'S' = Only save and load
'E' = All inherited 'F' = Inherited save and load + survey access + registration 'G' = Inherited survey access + registration + save and load 'H' = Inherited registration + save and load + survey access 'I' = Inherited save and load + inherited survey access + registration 'J' = Inherited survey access + inherited registration + save and load 'K' = Inherited registration + inherited save and load + survey access
'L' = Inherited survey access + save and load 'M' = Inherited survey access + registration 'O' = Inherited registration + survey access '1' = Inherited survey access + inherited registration '2' = Inherited survey access + inherited save and load '3' = Inherited registration + inherited save and load '4' = Inherited survey access '5' = Inherited save and load '6' = Inherited registration
'N' = None
todo | Should really be saved as three fields in the database! |
---|---|
\Survey
string
One character that corresponds to captcha usage
scopes()
inheritdoc | |
---|---|
search(): \CActiveDataProvider
\CActiveDataProvider
setAllowjumps(string $value)
string
setEncryptedAttributeLabel(integer $surveyId,string $className,string $attributeName): string
Throws |
|
---|
integer
string
string
string
setGoogleanalyticsapikeysetting(string $value): void
string
Google Analytics Key
setOptions( $gsid = 1)
setOptionsFromDatabase()
setToInherit()
setTokenEncryptionOptions( $options)
tableName()
inheritdoc | |
---|---|
updateAll(array $attributes,mixed $condition = '',array $params = array()): integer
XSS filtering is enforced for attributes listed in model's $xssFilterAttributes property. See \find() for detailed explanation about $condition and $params. Note, the attributes are not checked for safety and no validation is done.
array
list of attributes (name=>$value) to be updated
mixed
query condition or criteria.
array
parameters to be bound to an SQL statement.
integer
the number of rows being updated
findByPkCache :array
var |
---|
array
oOptions :
oOptionLabels :
aOptions :
showInherited :
searched_value :
showsurveypolicynotice :
bShowRealOptionValues :
sSurveyUrl :
xssFilterAttributes :array<mixed,string>
var | Array of attributes that should be XSS filtered on mass updates |
---|
array<mixed,string>
bEncryption :
sid :integer
Survey ID
integer
owner_id :integer
integer
gsid :integer
survey group id, from which this survey belongs to and inherits values from when set to 'I'
integer
admin :string
Survey Admin's full name
string
active :string
Whether survey is acive or not (Y/N)
string
expires :string
Expiry date (YYYY-MM-DD hh:mm:ss)
string
startdate :string
Survey Start date (YYYY-MM-DD hh:mm:ss)
string
adminemail :string
Survey administrator email address
string
anonymized :string
Whether survey is anonymized or not (Y/N)
string
format :string
A : All in one, G : Group by group, Q : question by question, I : inherit value from survey group
string
savetimings :string
Whether survey timings are saved (Y/N)
string
template :string
Template name
string
language :string
Survey base language
string
additional_languages :string
Survey additional languages delimited by space ' '
string
datestamp :string
Whether respondents' datestamps will be saved (Y/N)
string
allowregister :string
Allow public registration (Y/N)
string
allowsave :string
Is participant allowed save and resume later (Y/N)
string
autonumber_start :integer
integer
tokenlength :integer
Token length: MIN:5 MAX:36
integer
autoredirect :string
Automatically load URL when survey complete: (Y/N)
string
allowprev :string
Allow backwards navigation (Y/N)
string
printanswers :string
Participants may print answers: (Y/N)
string
ipaddr :string
Whether Participants IP address will be saved: (Y/N)
string
ipanonymize :string
Whether id addresses should be anonymized (Y/N)
string
refurl :string
Save referrer URL: (Y/N)
string
datecreated :string
Date survey was created (YYYY-MM-DD hh:mm:ss)
string
publicstatistics :string
Public statistics: (Y/N)
string
publicgraphs :string
Show graphs in public statistics: (Y/N)
string
listpublic :string
List survey publicly: (Y/N)
string
htmlemail :string
Use HTML format for token emails: (Y/N)
string
sendconfirmation :string
Send confirmation emails:(Y/N)
string
tokenanswerspersistence :string
Enable token-based response persistence: (Y/N)
string
assessments :string
Enable assessment mode: (Y/N)
string
usecaptcha :string
string
usetokens :string
string
bounce_email :string
Bounce email address
string
attributedescriptions :string
string
emailresponseto :string
e-mail address to send detailed admin notification email to
string
emailnotificationto :string
Email address to send basic admin notification email to
string
showxquestions :string
Show "There are X questions in this survey": (Y/N)
string
showgroupinfo :string
Show group name and/or group description: (Y/N)
string
shownoanswer :string
Show "No answer": (Y/N)
string
showqnumcode :string
Show question number and/or code: (Y/N)
string
bouncetime :integer
integer
bounceprocessing :string
string
bounceaccounttype :string
string
bounceaccounthost :string
string
bounceaccountpass :string
string
bounceaccountencryption :string
string
bounceaccountuser :string
string
showwelcome :string
Show welcome screen: (Y/N)
string
showprogress :string
how progress bar: (Y/N)
string
questionindex :integer
Show question index / allow jumping (0: diabled; 1: Incremental; 2: Full)
integer
nokeyboard :string
Show on-screen keyboard: (Y/N)
string
alloweditaftercompletion :string
Allow multiple responses or update responses with one token: (Y/N)
string
googleanalyticsstyle :string
Google Analytics style: (0: off; 1:Default; 2:Survey-SID/Group)
string
googleanalyticsapikey :string
Google Analytics Tracking ID
string
languagesettings :array<mixed,\SurveyLanguageSetting>
array<mixed,\SurveyLanguageSetting>
owner :\User
\User
groups :array<mixed,\QuestionGroup>
array<mixed,\QuestionGroup>
quotas :array<mixed,\Quota>
array<mixed,\Quota>
allQuestions :array<mixed,\Question>
All survey questions including subquestions
array<mixed,\Question>
baseQuestions :array<mixed,\Question>
Survey questions NOT including subquestions
array<mixed,\Question>
quotableQuestions :array<mixed,\Question>
array<mixed,\Question>
fullAnswers :array
array
partialAnswers :array
array
countFullAnswers :integer
Full-answers count
integer
countPartialAnswers :integer
Full-answers count
integer
countTotalAnswers :integer
Total-answers count
integer
groupsCount :integer
Number of groups in a survey (in base language)
integer
currentLanguageSettings :\SurveyLanguageSetting
Survey languagesettings in currently active language
\SurveyLanguageSetting
allLanguages :array<mixed,string>
array<mixed,string>
additionalLanguages :array<mixed,string>
Additional survey languages
array<mixed,string>
tokenAttributes :array
Additional token attribute names
array
creationDate :string
Creation date formatted according to user format
string
startDateFormatted :string
Start date formatted according to user format
string
expiryDateFormatted :string
Expiry date formatted according to user format
string
tokensTableName :string
Name of survey tokens table
string
responsesTableName :string
Name of survey resonses table
string
timingsTableName :string
Name of survey timings table
string
hasTokensTable :boolean
Whether survey has a tokens table or not
boolean
hasResponsesTable :boolean
Wheteher the survey responses (data) table exists in DB
boolean
hasTimingsTable :boolean
Wheteher the survey timings table exists in DB
boolean
googleanalyticsapikeysetting :string
Returns the value for the SurveyEdit GoogleAnalytics API-Key UseGlobal Setting
string
countTotalQuestions :integer
Count of questions (in that language, without subquestions)
integer
countInputQuestions :integer
Count of questions that need input (skipping text-display etc.)
integer
countNoInputQuestions :integer
Count of questions that DO NOT need input (skipping text-display etc.)
All Y/N columns in the model can be accessed as boolean values:
integer
isActive :boolean
Whether Survey is active
boolean
isAnonymized :boolean
Whether survey is anonymized or not
boolean
isSaveTimings :boolean
Whether survey timings are saved
boolean
isDateStamp :boolean
Whether respondents' datestamps will be saved
boolean
isUseCookie :boolean
Are cookies used to prevent repeated participation
boolean
isAllowRegister :boolean
Allow public registration
boolean
isAllowSave :boolean
Is participant allowed save and resume later
boolean
isAutoRedirect :boolean
Automatically load URL when survey complete
boolean
isAllowPrev :boolean
Allow backwards navigation
boolean
isPrintAnswers :boolean
Participants may print answers
boolean
isIpAddr :boolean
Whether Participants IP address will be saved
boolean
isIpAnonymize :boolean
Whether Participants IP address will be saved
boolean
isRefUrl :boolean
Save referrer URL
boolean
isPublicStatistics :boolean
Public statistics
boolean
isPublicGraphs :boolean
Show graphs in public statistics
boolean
isListPublic :boolean
List survey publicly
boolean
isHtmlEmail :boolean
Use HTML format for token emails
boolean
isSendConfirmation :boolean
Send confirmation emails
boolean
isTokenAnswersPersistence :boolean
Enable token-based response persistence
boolean
isAssessments :boolean
Enable assessment mode
boolean
isShowXQuestions :boolean
Show "There are X questions in this survey"
boolean
isShowGroupInfo :boolean
Show group name and/or group description
boolean
isShowNoAnswer :boolean
Show "No answer"
boolean
isShowQnumCode :boolean
Show question number and/or code
boolean
isShowWelcome :boolean
Show welcome screen
boolean
isShowProgress :boolean
how progress bar
boolean
showsurveypolicynotice :boolean
Show the security notice
boolean
isNoKeyboard :boolean
Show on-screen keyboard
boolean
isAllowEditAfterCompletion :boolean
Allow multiple responses or update responses with one token
boolean
defaultlanguage :\SurveyLanguageSetting
\SurveyLanguageSetting
isDateExpired :boolean
Whether survey is expired depending on the current time and survey configuration status
boolean