Functions

_countNumberOfEntries

package

Default

Arguments

$sTableName

« More »

_getDbName

Get the database name

package

Default

« More »

_getMaxNbRecords

package

Default

« More »

_outputDBData

package

Default

Arguments

$bAllowExportAllDb

$bEchoOutput

$sFileName

$oFile

« More »

_outputDBDescription

package

Default

Arguments

$sDbName

$bAllowExportAllDb

« More »

_outputRecords

package

Default

Arguments

$sTableName

$aFieldNames

$aRecords

« More »

_outputTableData

Outputs the table data in sql format

package

Default

Arguments

$sTableName

$oTableData

$bEchoOutput

$sFileName

$oFile

« More »

_outputTableDescription

Outputs the table structure in sql format

package

Default

Arguments

$sTableName

« More »

activateSurvey

Function to activate a survey

package

Default

Arguments

$iSurveyID

integer

The Survey ID

$simulate

boolean

Response

array

« More »

addColumn

package

Default

Arguments

$sTableName

$sColumn

$sType

string

« More »

addPrimaryKey

package

Default

Arguments

$sTablename

string

$aColumns

« More »

addtoarray_single

Takes two single element arrays and adds second to end of first if value exists Why not use array_merge($array1,array_filter($array2);

package

Default

Arguments

$array1

$array2

« More »

aEncodingsArray

Return accepted codingsArray for importing files

Used in vvimport TODO : use in token and

package

Default

Response

array

« More »

alterColumn

package

Default

Arguments

$sTable

$sColumn

string

$sFieldType

string

$bAllowNull

$sDefault

« More »

alterLanguageCode

Renames a language code in the whole LimeSurvey database

package

Default

Arguments

$sOldLanguageCode

string

$sNewLanguageCode

string

« More »

alternation

package

Default

Arguments

$alternate

$type

« More »

App

Helper function to replace calls to Yii::app() and enable correct code completion.

package

Default

Response

\LSYii_Application

« More »

array_diff_assoc_recursive

package

Default

Arguments

$array1

$array2

« More »

arraySearchByKey

package

Default

Arguments

$needle

mixed

$haystack

mixed

$keyname

string

$maxanswers

integer

Response

array

« More »

beautify_filename

package

Default

Arguments

$filename

string

« More »

breakOutAndCrash

package

Default

todo

Rename

Move HTML to view

Arguments

$sTemplateViewPath

string

$totalquestions

integer

$iTotalGroupsWithoutQuestions

integer

$thissurvey

array

« More »

breakToNewline

package

Default

Arguments

$data

« More »

buildLabelSetCheckSumArray

package

Default

« More »

buildSelects

Builds the list of addon SQL select statements that builds the query result set

@param array $allfields An array containing the names of the fields/answers we want to display in the statistics summary

package

Default

Arguments

$allfields

$surveyid

integer

@param string $language The language to use

@return array $selects array of individual select statements that can be added/appended to the 'where' portion of a SQL statement to restrict the result set ie: array("FIELDNAME='Y'", "FIELDNAME2='Hello'");

$language

« More »

buildSelects

Builds the list of addon SQL select statements that builds the query result set

@param array $allfields An array containing the names of the fields/answers we want to display in the statistics summary

package

Default

Arguments

$allfields

$surveyid

integer

@param string $language The language to use

@return array $selects array of individual select statements that can be added/appended to the 'where' portion of a SQL statement to restrict the result set ie: array("FIELDNAME='Y'", "FIELDNAME2='Hello'");

$language

« More »

buildsurveysession

This function builds all the required session variables when a survey is first started and it loads any answer defaults from command line or from the table defaultvalues It is called from the related format script (group.php, question.php, survey.php) if the survey has just started.

package

Default

Arguments

$surveyid

integer

$preview

boolean

Defaults to false

« More »

buildXMLFromQuery

buildXMLFromQuery() creates a datadump of a table in XML using XMLWriter

package

Default

Arguments

$xmlwriter

mixed

The existing XMLWriter object

$Query

mixed

The table query to build from

$tagname

string

If the XML tag of the resulting question should be named differently than the table name set it here

$excludes

array<mixed,string>

array of columnames not to include in export

« More »

calculateTotalFileUploadUsage

This function calculates how much space is actually used by all files uploaded using the File Upload question type

package

Default

returns

integer Actual space used in MB

« More »

canShowDatePicker

Check whether we can show the JS date picker with the current format

package

Default

returns

integer

Arguments

$dateformatdetails

array Date format details for the question

$dateformats

array Available date formats

« More »

categorySort

package

Default

Arguments

$a

$b

« More »

check

package

Default

Arguments

$input

$flags

$min

$max

« More »

check_float

package

Default

Arguments

$input

$min

$max

« More »

check_html_string

package

Default

Arguments

$input

$min

$max

« More »

check_int

package

Default

Arguments

$input

$min

$max

« More »

check_ldap_string

package

Default

Arguments

$input

$min

$max

« More »

check_paranoid_string

package

Default

Arguments

$input

$min

$max

« More »

check_system_string

package

Default

Arguments

$input

$min

$max

« More »

checkCompletedQuota

checkCompletedQuota() returns matched quotas information for the current response

package

Default

Arguments

$surveyid

integer

  • Survey identification number

$return

boolean

  • set to true to return information, false do the quota

Response

array|void

  • nested array, Quotas->Members->Fields, includes quota information matched in session.

« More »

checkFile

package

Default

Arguments

$filename

« More »

CheckForDBUpgrades

This functions checks if the databaseversion in the settings table is the same one as required If not then the necessary upgrade procedures are run

package

Default

Arguments

$subaction

« More »

checkGroup

checks consistency of groups

package

Default

Arguments

$postsid

integer

Response

\

« More »

checkMoveQuestionConstraintsForConditions

checkMoveQuestionConstraintsForConditions()

package

Default

Arguments

$sid

string

  • the currently selected survey

$qid

string

  • qid of the question you want to check possible moves

$newgid

string

  • (optionnal) get only constraints when trying to move to this particular GroupId otherwise, get all moves constraints for this question

Response

array

  • returns an array describing the conditions Array ( ['notAbove'] = null | Array ( Array ( gid1, group_order1, qid1, cid1 ) ) ['notBelow'] = null | Array ( Array ( gid2, group_order2, qid2, cid2 ) ) )

This should be read as:

  • this question can't be move above group gid1 in position group_order1 because of the condition cid1 on question qid1
  • this question can't be move below group gid2 in position group_order2 because of the condition cid2 on question qid2

« More »

checkPassthruLabel

Check if a passthru label and value have been included in the query url

package

Default

Arguments

$surveyid

integer

$preview

boolean

$fieldmap

« More »

checkQuestions

checks questions in a survey for consistency

package

Default

Arguments

$postsid

integer

$iSurveyID

integer

$qtypes

Response

array|boolean

$faildcheck

« More »

checkStatic

package

Default

Arguments

$line

« More »

checkUploadedFileValidity

checkUploadedFileValidity used in SurveyRuntimeHelper

package

Default

Arguments

$surveyid

$move

$backok

« More »

clean

package

Default

Arguments

$item

« More »

cleanLanguagesFromSurvey

cleanLanguagesFromSurvey() removes any languages from survey tables that are not in the passed list

package

Default

Arguments

$sid

string

  • the currently selected survey

$availlangs

string

  • space separated list of additional languages in survey

Response

boolean

  • always returns true

« More »

cleanTempDirectory

This function cleans files from the temporary directory being older than 1 day

package

Default

todo

Make the days configurable

« More »

cmpErrorTokens

Used by usort() to order Error tokens by their position within the string This must be outside of the class in order to work in PHP 5.2

package

Default

Arguments

$a

array

$b

array

Response

integer

« More »

cmpQuestionSeq

Used by usort() to order $this->questionSeq2relevance in proper order

package

Default

Arguments

$a

array

$b

array

Response

integer

« More »

conditionalNewlineToBreak

used to translate simple text to html (replacing \n with <br />

package

Default

Arguments

$mytext

mixed

$ishtml

mixed

$encoded

Response

mixed

« More »

convertDateTimeFormat

This is a convenience function for the coversion of datetime values

package

Default

Arguments

$value

mixed

$fromdateformat

string

$todateformat

mixed

Response

string

« More »

convertGETtoPOST

package

Default

Arguments

$url

« More »

convertLStoDateTimePickerLocale

This functions translates LimeSurvey specific locale code to a matching datetimepicker locale

package

Default

Arguments

$sLocale

string

LimeSurvey locale code

« More »

convertPHPSizeToBytes

This function transforms the php.ini notation for numbers (like '2M') to an integer (2*1024*1024 in this case)

package

Default

Arguments

$sSize

string

Response

integer

The value in bytes

« More »

convertToGlobalSettingFormat

This is a convenience function to convert any date, in any date format, to the global setting date format Check if the time shoul be rendered also

package

Default

Arguments

$sDate

string

$withTime

boolean

Response

string

« More »

cookieConsentLocalization

For later use, don't remove.

package

Default

Response

\array

« More »

CPDBExport

package

Default

Arguments

$data

$filename

string

« More »

createBoxes250

Create boxes table

package

Default

« More »

createChart

Generate a chart for a question

@param int $iQuestionID ID of the question

package

Default

Arguments

$iQuestionID

$iSurveyID

integer

ID of the survey @param mixed $type Type of the chart to be created - null produces bar chart, any other value produces pie chart @param array $lbl An array containing the labels for the chart items @param mixed $gdata An array containing the percentages for the chart items @param mixed $grawdata An array containing the raw count for the chart items @param pCache $cache An object containing [Hashkey] and [CacheFolder] @param mixed $sLanguageCode Language Code @param string $sQuestionType The question type @return false|string

$type

$lbl

$gdata

$grawdata

$cache

$sLanguageCode

$sQuestionType

« More »

createChart

Generate a chart for a question

@param int $iQuestionID ID of the question

package

Default

Arguments

$iQuestionID

$iSurveyID

integer

ID of the survey @param mixed $type Type of the chart to be created - null produces bar chart, any other value produces pie chart @param array $lbl An array containing the labels for the chart items @param mixed $gdata An array containing the percentages for the chart items @param mixed $grawdata An array containing the raw count for the chart items @param pCache $cache An object containing [Hashkey] and [CacheFolder] @param mixed $sLanguageCode Language Code @param string $sQuestionType The question type @return false|string

$type

$lbl

$gdata

$grawdata

$cache

$sLanguageCode

$sQuestionType

« More »

createCompleteSGQA

This functions generates a a summary containing the SGQA for questions of a survey, enriched with options per question It can be used for the generation of statistics. Derived from Statistics_userController

package

Default

Arguments

$iSurveyID

integer

Id of the Survey in question

$aFilters

array

an array which is the result of a query in Questions model

$sLanguage

string

Response

array

The summary

« More »

createDatabase

package

Default

Arguments

$oDB

« More »

createFieldMap

This function generates an array containing the fieldcode, and matching data in the same order as the activate script

package

Default

Arguments

$survey

\Survey

$style

string

'short' (default) or 'full' - full creates extra information like default values

$force_refresh

boolean

  • Forces to really refresh the array, not just take the session copy

$questionid

boolean|integer

Limit to a certain qid only (for question preview) - default is false

$sLanguage

string

The language to use

$aDuplicateQIDs

array

Response

array

« More »

createPassword

package

Default

« More »

createSurveyGroupTables306

package

Default

Arguments

$oDB

\CDbConnection

« More »

createSurveyMenuTable

package

Default

Arguments

$oDB

\CDbConnection

« More »

createTimingsFieldMap

This function generates an array containing the fieldcode, and matching data in the same order as the activate script

package

Default

Arguments

$surveyid

string

The Survey ID

$style

string

'short' (default) or 'full' - full creates extra information like default values

$force_refresh

boolean

  • Forces to really refresh the array, not just take the session copy

$questionid

integer

Limit to a certain qid only (for question preview) - default is false

$sQuestionLanguage

string

The language to use

Response

array

« More »

CSVImportResponses

This function imports a CSV file into the response table

package

Default

Arguments

$sFullFilePath

string

$iSurveyId

integer

$aOptions

array

Return array $result ("errors","warnings","success")

« More »

CSVUnquote

This function removes surrounding and masking quotes from the CSV field

package

Default

Arguments

$field

mixed

Response

mixed

« More »

currentRelevecanceClass

Return class of a specific row (hidden by relevance)

package

Default

Arguments

$surveyId

integer

actual survey id

$baseName

string

the base name of the question

$name

string

The name of the question/row to test

$aQuestionAttributes

array

the question attributes

Response

string

« More »

dateShift

example usage $date = "2006-12-31 21:00"; $shift "+6 hours"; // could be days, weeks.

.. see function strtotime() for usage

echo sql_date_shift($date, "Y-m-d H:i:s", $shift);

will output: 2007-01-01 03:00:00

package

Default

Arguments

$date

string

$dformat

string

$shift

mixed

Response

string

« More »

db_upgrade_all

package

Default

Arguments

$iOldDBVersion

integer

The previous database version

$bSilent

boolean

Run update silently with no output - this checks if the update can be run silently at all. If not it will not run any updates at all.

« More »

dbExecuteAssoc

package

Default

deprecated

Do not use anymore. If you see this replace it with a proper CDbCommand query

Throws
\Exception

Arguments

$sql

string

$inputarr

array|boolean

$silent

boolean

Response

boolean|\CDbDataReader

« More »

dbGetTablesLike

Gets the table names. Do not prefix.

package

Default

uses

To get the tables like sql query

Arguments

$table

string

String to match

Response

array

Array of matched table names

« More »

dbRandom

Return the random function to use in ORDER BY sql statements

package

Default

Response

string

« More »

dbSelectTablesLike

Return a sql statement for finding LIKE named tables Be aware that you have to escape underscore chars by using a backslash otherwise you might get table names returned you don't want

package

Default

Arguments

$table

mixed

Response

string

« More »

decodeTokenAttributes

Decodes token attribute data because due to bugs in the past it can be written in JSON or be serialized - future format should be JSON as serialized data can be exploited

package

Default

Arguments

$oTokenAttributeData

string

The original token attributes as stored in the database

Response

array|mixed

« More »

deletelabelset

Deletes a label set alog with its labels

package

Default

Arguments

$lid

mixed

Label ID

Response

boolean

Returns always true

« More »

display_first_page

Shows the welcome page, used in group by group and question by question mode

package

Default

Arguments

$thissurvey

$aSurveyInfo

« More »

do_5pointchoice

package

Default

Arguments

$ia

« More »

do_array

package

Default

Arguments

$ia

« More »

do_array_10point

package

Default

Arguments

$ia

« More »

do_array_5point

Construct answer part array_5point

package

Default

Arguments

$ia

array

Response

array

« More »

do_array_dual

package

Default

Arguments

$ia

« More »

do_array_increasesamedecrease

package

Default

Arguments

$ia

« More »

do_array_multiflexi

package

Default

Arguments

$ia

« More »

do_array_texts

package

Default

Arguments

$ia

« More »

do_array_yesnouncertain

package

Default

Arguments

$ia

« More »

do_arraycolumns

package

Default

Arguments

$ia

« More »

do_boilerplate

package

Default

Arguments

$ia

« More »

do_date

package

Default

Arguments

$ia

« More »

do_equation

package

Default

Arguments

$ia

« More »

do_file_upload

package

Default

Arguments

$ia

« More »

do_gender

package

Default

Arguments

$ia

« More »

do_hugefreetext

package

Default

Arguments

$ia

« More »

do_language

package

Default

Arguments

$ia

« More »

do_list_dropdown

package

Default

Arguments

$ia

« More »

do_list_radio

package

Default

Arguments

$ia

« More »

do_listwithcomment

package

Default

Arguments

$ia

« More »

do_longfreetext

package

Default

Arguments

$ia

« More »

do_multiplechoice

package

Default

Arguments

$ia

« More »

do_multiplechoice_withcomments

package

Default

Arguments

$ia

« More »

do_multiplenumeric

package

Default

Arguments

$ia

« More »

do_multipleshorttext

package

Default

Arguments

$ia

« More »

do_numerical

package

Default

Arguments

$ia

« More »

do_ranking

package

Default

Arguments

$ia

« More »

do_shortfreetext

package

Default

Arguments

$ia

« More »

do_yesno

package

Default

Arguments

$ia

« More »

doAssessment

Caculate assessement scores

package

Default

Arguments

$surveyid

mixed

Response

array

« More »

doFooter

package

Default

« More »

doHeader

package

Default

« More »

doRender

Render the question view.

By default, it just renders the required core view from application/views/survey/... If user added a question template in the upload dirctory, add applied it to the question in its display settings, then the function will check if the required view exist in this directory and then will use this one to render the question.

Rem: all the logic has been moved to LSETwigViewRenderer::renderQuestion() We keep the function doRender here for convenience (it will probably be removed in further cycles of dev). *

package

Default

Arguments

$sView

string

name of the view to be rendered.

$aData

array

data to be extracted into PHP variables and made available to the view script

$bReturn

boolean

whether the rendering result should be returned instead of being displayed to end users (should be always true)

« More »

doreplacement

package

Default

Arguments

$file

string

$data

$oTemplate

« More »

dropColumn

Drops a column, automatically removes blocking default value on MSSQL

package

Default

Arguments

$sTableName

string

$sColumnName

string

« More »

dropDefaultValueMSSQL

Drop a default value in MSSQL

package

Default

Arguments

$fieldname

string

$tablename

mixed

« More »

dropPrimaryKey

Drops the primary key of a table

package

Default

Arguments

$sTablename

string

$oldPrimaryKeyColumn

string

« More »

dropSecondaryKeyMSSQL

This function drops a secondary key of an MSSQL database field by using the field name and the table name

package

Default

Arguments

$sFieldName

string

$sTableName

mixed

« More »

dropUniqueKeyMSSQL

This function drops a unique Key of an MSSQL database field by using the field name and the table name

package

Default

Arguments

$sFieldName

string

$sTableName

string

« More »

ellipsize

Ellipsize String

This public static function will strip tags from a string, split it at its max_length and ellipsize

package

Default

Arguments

$sString

string

string to ellipsize

$iMaxLength

integer

max length of string

$fPosition

integer

int (1|0) or float, .5, .2, etc for position to split

$sEllipsis

string

ellipsis ; Default '...'

Response

string

ellipsized string

« More »

emailTokens

Sends email to tokens - invitations, reminders, registers, and confirmations

package

Default

Arguments

$iSurveyID

integer

$aResultTokens

array<mixed,\CActiveRecord>

$sType

string

type of notification invite|register|remind|confirm

Response

array

of results

« More »

encodeEmail

encodeEmail : encode admin email in public part

package

Default

Arguments

$mail

mixed

$text

mixed

$class

mixed

$params

mixed

Response

mixed|string

« More »

enforceSSLMode

enforceSSLMode() $force_ssl is on or off, it checks if the current request is to HTTPS (or not). If $force_ssl is on, and the request is not to HTTPS, it redirects the request to the HTTPS version of the URL, if the request is to HTTPS, it rewrites all the URL variables so they also point to HTTPS.

package

Default

« More »

eT

Translation helper function which outputs right away.

package

Default

Arguments

$sToTranslate

string

$sEscapeMode

string

« More »

expr_mgr_htmlspecialchars

Javascript equivalent does not cope well with ENT_QUOTES and related PHP constants, so set default to ENT_QUOTES

package

Default

Arguments

$string

string

Response

string

« More »

expr_mgr_htmlspecialchars_decode

Javascript equivalent does not cope well with ENT_QUOTES and related PHP constants, so set default to ENT_QUOTES

package

Default

Arguments

$string

string

Response

string

« More »

exprmgr_convert_value

Find the closest matching numerical input values in a list an replace it by the corresponding value within another list

package

Default

author

Johannes Weberhofer, 2013

Arguments

$fValueToReplace

double

$iStrict

integer

  • 1 for exact matches only otherwise interpolation the closest value should be returned

$sTranslateFromList

string

  • comma seperated list of numeric values to translate from

$sTranslateToList

string

  • comma seperated list of numeric values to translate to

Response

integer|null

« More »

exprmgr_count

Count the number of answered questions (non-empty)

package

Default

Arguments

$args

array

Response

integer

« More »

exprmgr_countif

Count the number of answered questions (non-empty) which match the first argument

package

Default

Arguments

$args

array

Response

integer

« More »

exprmgr_countifop

Count the number of answered questions (non-empty) which meet the criteria (arg op value)

package

Default

Arguments

$args

array

Response

integer

« More »

exprmgr_date

Return format a local time/date Need to test if timestamp is numeric (else E_WARNING with debug>0)

package

Default

link

http://php.net/function.date.php

Arguments

$format

string

$timestamp

integer

Response

string|false

« More »

exprmgr_empty

Return true if the variable is NULL or blank.

package

Default

Arguments

$arg

null|string|boolean

Response

boolean

« More »

exprmgr_fixnum

Display number with comma as radix separator, if needed

package

Default

Arguments

$value

string

Response

string

« More »

exprmgr_if

If $test is true, return $iftrue, else return $iffalse

package

Default

Arguments

$testDone

mixed

$iftrue

mixed

$iffalse

mixed

Response

mixed

« More »

exprmgr_implode

Join together $args[1-N] with $arg[0]

package

Default

Arguments

$args

array

Response

string

« More »

exprmgr_int

Return true if the variable is an integer for LimeSurvey Can not really use is_int due to SQL DECIMAL system. This function can surely be improved

package

Default

link

http://php.net/is_int#82857

Arguments

$arg

string

Response

integer

« More »

exprmgr_join

Join together $args[N]

package

Default

Arguments

$args

array

Response

string

« More »

exprmgr_list

Join together $args[0-N] with ', '

package

Default

Arguments

$args

array

Response

string

« More »

exprmgr_log

return log($arg[0],$arg[1]=e)

package

Default

Arguments

$args

array

Response

float

« More »

exprmgr_mktime

Get Unix timestamp for a date : false if parameters is invalid.

Get default value for unset (or null) value E_NOTICE if arguments are not numeric (debug>0), then test it before

package

Default

Arguments

$hour

integer

$minute

integer

$second

integer

$month

integer

$day

integer

$year

integer

Response

integer|boolean

« More »

exprmgr_regexMatch

Return true if $input matches the regular expression $pattern

package

Default

Arguments

$pattern

string

$input

string

Response

boolean

« More »

exprmgr_stddev

Compute the Sample Standard Deviation of a set of numbers ($args[0-N])

package

Default

Arguments

$args

array

Response

float

« More »

exprmgr_stripos

Find position of first occurrence of unicode string in a unicode string, case insensitive

package

Default

Arguments

$haystack

string

: checked string

$needle

string

: string to find

$offset

: offset

Response

integer|false

: position or false if not found

« More »

exprmgr_stristr

Finds first occurrence of a unicode string within another, case-insensitive

package

Default

Arguments

$haystack

string

: checked string

$needle

string

: string to find

$before_needle

boolean

: portion to return

Response

string|false

« More »

exprmgr_strlen

Get unicode string length

package

Default

Arguments

$string

string

Response

integer

« More »

exprmgr_strpos

Find position of first occurrence of unicode string in a unicode string

package

Default

Arguments

$haystack

string

: checked string

$needle

string

: string to find

$offset

integer

: offset

Response

integer|false

: position or false if not found

« More »

exprmgr_strstr

Finds first occurrence of a unicode string within another

package

Default

Arguments

$haystack

string

: checked string

$needle

string

: string to find

$before_needle

boolean

: portion to return

Response

string|false

« More »

exprmgr_strtolower

Make an unicode string lowercase

package

Default

Arguments

$string

string

Response

string

« More »

exprmgr_strtoupper

Make an unicode string uppercase

package

Default

Arguments

$string

string

Response

string

« More »

exprmgr_substr

Get part of unicode string

package

Default

Arguments

$string

string

$start

integer

$end

integer

Response

string

« More »

exprmgr_sumifop

Sum of values of answered questions which meet the criteria (arg op value)

package

Default

Arguments

$args

array

Response

integer

« More »

exprmgr_unique

Returns true if all non-empty values are unique

package

Default

Arguments

$args

array

Response

boolean

« More »

file_validation_message

package

Default

Arguments

$ia

« More »

file_validation_popup

package

Default

Arguments

$ia

$filenotvalidated

boolean

« More »

fillDate

Take a date string and fill out missing parts, like day, hour, minutes (not seconds).

If string is NOT in standard date format (Y-m-d H:i), this methods makes no sense. Used when fetching answer for do_date, where answer can come from a default answer expression like date('Y'). Will also truncate date('c') to format Y-m-d H:i.

package

Default

Arguments

$dateString

string

Response

string

« More »

filterForAttributes

This is a helper function for getAttributeFieldNames

package

Default

Arguments

$fieldname

mixed

Response

boolean

« More »

finalizeRandomization

Stuff?

package

Default

Arguments

$fieldmap

array

Response

array

Fieldmap

« More »

fixCKeditorText

package

Default

Arguments

$str

string

« More »

fixKCFinder184

package

Default

« More »

fixLanguageConsistency

fixLanguageConsistency() fixes missing groups, questions, answers, quotas & assessments for languages on a survey

package

Default

Arguments

$sid

string

  • the currently selected survey

$availlangs

string

  • space separated list of additional languages in survey - if empty all additional languages of a survey are checked against the base language

Response

boolean

  • always returns true

« More »

fixLanguageConsistencyAllSurveys

package

Default

« More »

fixMovedQuestionConditions

package

Default

Arguments

$qid

integer

$oldgid

$newgid

integer

$iSurveyID

integer

« More »

fixMySQLCollations

package

Default

Arguments

$sEncoding

string

$sCollation

string

« More »

fixNumbering

fixes the numbering of questions This can happen if question 1 have subquestion code 1 and have question 11 in same survey and group (then same SGQA)

package

Default

todo

can call this function (no $_GET, but getParam) AND do it with Yii

Arguments

$iQuestionID

$iSurveyID

integer

« More »

fixorder

Function rewrites the sortorder for a label set

package

Default

Arguments

$lid

mixed

Label set ID

« More »

fixSortOrderGroups

package

Default

Arguments

$surveyid

« More »

fixSubquestions

This function fixes the group ID and type on all subquestions Optimized for minimum memory usage even on huge databases

package

Default

« More »

flattenText

This functions removes all HTML tags, Javascript, CRs, linefeeds and other strange chars from a given text

package

Default

Arguments

$sTextToFlatten

string

Text you want to clean

$bKeepSpan

boolean

set to true for keep span, used for expression manager. Default: false

$bDecodeHTMLEntities

boolean

If set to true then all HTML entities will be decoded to the specified charset. Default: false

$sCharset

string

Charset to decode to if $decodeHTMLEntities is set to true. Default: UTF-8

$bStripNewLines

string

strip new lines if true, if false replace all new line by \r\n. Default: true

Response

string

Cleaned text

« More »

folderSize

Calculate folder size NB: If this function is changed, please notify LimeSurvey GmbH.

An exact copy of this function is used to calculate storage limit on LimeSurvey Pro hosting.

package

Default

Arguments

$dir

string

Folder

Response

integer

Size in bytes.

« More »

get_absolute_path

A function to remove .

./ or ./ from paths to prevent directory traversal

package

Default

Arguments

$path

mixed

« More »

getArrayFilterExcludesCascadesForGroup

getArrayFilterExcludesCascadesForGroup() queries the database and produces a list of array_filter_exclude questions and targets with in the same group

package

Default

Arguments

$surveyid

$gid

$output

Response

array

a keyed nested array, keyed by the qid of the question, containing cascade information

« More »

getAttributeFieldNames

Retrieves the attribute field names from the related survey participants table

package

Default

Arguments

$iSurveyID

mixed

The survey ID

Response

array

The fieldnames

« More »

getBounceEmail

package

Default

Arguments

$surveyid

« More »

getBrowserLanguage

This function tries to find out a valid language code for the language of the browser used If it cannot find it it will return the default language from global settings

package

Default

« More »

getDateFormatData

Returns all available dateformats in a structured aray If $iDateFormat is given only the particual dateformat will be returned

package

Default

returns

array

Arguments

$iDateFormat

integer

$sLanguageCode

string

« More »

getDateFormatDataForQID

Get the date format details for a specific question.

package

Default

returns

array

Arguments

$aQidAttributes

array Question attributes

$mThisSurvey

mixed Array of Survey attributes or surveyid

« More »

getDateFormatForSID

Get the date format for a specified survey

package

Default

returns

integer

Arguments

$surveyid

integer Survey id

$languagecode

string Survey language code (optional)

« More »

getDBConnectionStringProperty

package

Default

Arguments

$sProperty

string

« More »

getDirectorySize

package

Default

Arguments

$directory

string

Response

integer

« More »

getEditor

package

Default

Arguments

$fieldtype

$fieldname

$fieldtext

$surveyID

$gID

$qID

$action

« More »

getEmailFormat

package

Default

Arguments

$surveyid

« More »

geterrors_exprmgr_regexMatch

Return error information from pattern of regular expression $pattern

package

Default

Arguments

$pattern

string

$input

string

Response

string|null

« More »

getExtendedAnswer

package

Default

Arguments

$iSurveyID

integer

The Survey ID

$sFieldCode

string

Field code of the particular field

$sValue

string

The stored response value

$sLanguage

string

Initialized limesurvey_lang object for the resulting response data

Response

string

« More »

getFooter

This function returns the Footer as result string If you want to echo the Footer use doFooter()!

package

Default

Response

string

« More »

getFullResponseTable

Creates an array with details on a particular response for display purposes Used in Print answers, Detailed response view and Detailed admin notification email

package

Default

Arguments

$iSurveyID

mixed

$iResponseID

mixed

$sLanguageCode

mixed

$bHonorConditions

boolean

Apply conditions

Response

array

« More »

getGidNext

getGidNext() returns the Gid of the group next to the current active group

package

Default

Arguments

$surveyid

integer

$gid

integer

Response

integer|string

The Gid of the next group or blank string if no group

« More »

getGidPrevious

getGidPrevious() returns the Gid of the group prior to the current active group

package

Default

Arguments

$surveyid

integer

$gid

integer

Response

integer|string

The GID of the previous group or blank string if no group

« More »

getGlobalSetting

Returns a global setting

package

Default

Arguments

$settingname

string

Response

string

« More »

getGroupDepsForConditions

getGroupDepsForConditions() get Dependencies between groups caused by conditions

package

Default

Arguments

$sid

string

  • the currently selected survey

$depgid

string

  • (optionnal) get only the dependencies applying to the group with gid depgid

$targgid

string

  • (optionnal) get only the dependencies for groups dependents on group targgid

$indexby

string

  • (optionnal) "by-depgid" for result indexed with $res[$depgid][$targgid] "by-targgid" for result indexed with $res[$targgid][$depgid]

Response

array

  • returns an array describing the conditions or NULL if no dependecy is found

Example outupt assumin $index-by="by-depgid": Array ( [125] => Array // Group Id 125 is dependent on ( [123] => Array // Group Id 123 ( [depgpname] => G3 // GID-125 has name G3 [targetgpname] => G1 // GID-123 has name G1 [conditions] => Array ( [189] => Array // Because Question Id 189 ( [0] => 9 // Have condition 9 set [1] => 10 // and condition 10 set [2] => 14 // and condition 14 set )

                   )

           )

       [124] => Array         // GID 125 is also dependent on GID 124
           (
               [depgpname] => G3
               [targetgpname] => G2
               [conditions] => Array
                   (
                       [189] => Array // Because Question Id 189 have conditions set
                           (
                               [0] => 11
                           )

                       [215] => Array // And because Question Id 215 have conditions set
                           (
                               [0] => 12
                           )

                   )

           )

   )

)

Usage example:

  • Get all group dependencies for SID $sid indexed by depgid: $result=getGroupDepsForConditions($sid);
  • Get all group dependencies for GID $gid in survey $sid indexed by depgid: $result=getGroupDepsForConditions($sid,$gid);
  • Get all group dependents on group $gid in survey $sid indexed by targgid: $result=getGroupDepsForConditions($sid,"all",$gid,"by-targgid");

« More »

getGroupList

getGroupList() queries the database for a list of all groups matching the current survey sid

package

Default

Arguments

$gid

string

  • the currently selected gid/group

$surveyid

integer

Response

string

string is returned containing formatted list of groups to current survey

« More »

getGroupList3

package

Default

Arguments

$gid

$surveyid

« More »

getGroupListLang

put your comment there.

..

package

Default

Arguments

$gid

mixed

$language

mixed

$surveyid

Response

string

« More »

getGroupOrder

getGroupOrder($surveyid,$gid) queries the database for the sortorder of a group.

package

Default

Arguments

$surveyid

mixed

$gid

mixed

Response

mixed

« More »

getGroupUserList

package

Default

Arguments

$ugid

« More »

getHeader

get the header

package

Default

Arguments

$meta

boolean

: not used in any call (2016-10-18)

Response

string

« More »

getInlineEditor

package

Default

Arguments

$fieldtype

$fieldname

$fieldtext

$surveyID

$gID

$qID

$action

« More »

getIPAddress

This function returns the real IP address under all configurations

package

Default

« More »

getJSDateFromDateFormat

Convert a 'dateformat' format string to a 'jsdate' format.

For Bootstrap, that means using capital letters, e.g. MM/DD/YYYY instead of mm/dd/yyyy and mm instead of MM for minutes.

package

Default

returns

string

Arguments

$sDateformat

string

« More »

getLabelInputWidth

Find the label / input width

package

Default

Arguments

$labelAttributeWidth

string|integer

label width from attribute

$inputAttributeWidth

string|integer

input width from attribute

Response

array

labelWidth as integer,inputWidth as integer,defaultWidth as boolean

« More »

getLabelSets

Returns labelsets for given language(s), or for all if null

package

Default

Arguments

$languages

string

Response

array

« More »

getLanguageChangerDatas

This function creates the language selector for a particular survey

package

Default

Arguments

$sSelectedLanguage

string

: lang to be selected (forced)

Response

array|false

: array of data if more than one language, else false

« More »

getLanguageChangerDatasPublicList

This function creates the language selector for the public survey index page

package

Default

Arguments

$sSelectedLanguage

string

The language in which all information is shown

Response

array|boolean

« More »

getLanguageCodefromLanguage

package

Default

Arguments

$languagetosearch

« More »

getLanguageData

package

Default

Arguments

$bOrderByNative

$sLanguageCode

« More »

getLanguageDataRestricted

package

Default

Arguments

$bOrderByNative

$sDetail

« More »

getLanguageDetails

Returns the locale settings for a certain language code

package

Default

Arguments

$codetosearch

string

Response

array

Array with locale details

« More »

getLanguageNameFromCode

Returns a language name from the code

package

Default

returns

string|array

todo

Should not give back different data types

Arguments

$codetosearch

string

$withnative

boolean

$sTranslationLanguage

string

« More »

getLanguageRTL

package

Default

Arguments

$sLanguageCode

« More »

getLastInsertID

Retrieves the last Insert ID realiable for cross-DB applications

package

Default

Arguments

$sTableName

string

Needed for Postgres and MSSQL

Response

string

« More »

getLatLongFromIp

package

Default

Arguments

$sIPAddress

« More »

getListOfFiles

package

Default

Arguments

$wh

« More »

getMaxGroupOrder

Queries the database for the maximum sortorder of a group and returns the next higher one.

package

Default

Arguments

$surveyid

integer

Response

integer

« More »

getMaximumFileUploadSize

package

Default

« More »

getMaxQuestionOrder

Queries the database for the maximum sort order of a question.

package

Default

Arguments

$gid

integer

$surveyid

integer|null

Response

integer

« More »

getMove

getMove get move button clicked

package

Default

Response

string

« More »

getNavigatorDatas

TODO: call this function from surveyRuntimeHelper TODO: remove surveymover()

package

Default

« More »

GetNewSurveyID

This function returns a new random sid if the existing one is taken, otherwise it returns the old one.

package

Default

Arguments

$iDesiredSurveyId

mixed

« More »

getParticipantAttributes

Returns the full list of attribute token fields including the properties for each field Use this instead of plain Survey::model()->findByPk($iSurveyID)->tokenAttributes calls because Survey::model()->findByPk($iSurveyID)->tokenAttributes may contain old descriptions where the fields does not physically exist

package

Default

Arguments

$iSurveyID

integer

The Survey ID

Response

array

« More »

getPHPDateFromDateFormat

Convert a 'dateformat' format string to a 'phpdate' format.

package

Default

returns

string

Arguments

$sDateformat

string

string

« More »

getPopupEditor

package

Default

Arguments

$fieldtype

$fieldname

$fieldtext

$surveyID

$gID

$qID

$action

« More »

getPrintableHeader

This function returns the header for the printable survey

package

Default

Response

String

« More »

getQuestDepsForConditions

getQuestDepsForConditions() get Dependencies between groups caused by conditions

package

Default

Arguments

$sid

string

  • the currently selected survey

$gid

string

  • (optionnal) only search dependecies inside the Group Id $gid

$depqid

string

  • (optionnal) get only the dependencies applying to the question with qid depqid

$targqid

string

  • (optionnal) get only the dependencies for questions dependents on question Id targqid

$indexby

string

  • (optionnal) "by-depqid" for result indexed with $res[$depqid][$targqid] "by-targqid" for result indexed with $res[$targqid][$depqid]

$searchscope

Response

array

  • returns an array describing the conditions or NULL if no dependecy is found

Example outupt assumin $index-by="by-depqid": Array ( [184] => Array // Question Id 184 ( [183] => Array // Depends on Question Id 183 ( [0] => 5 // Because of condition Id 5 )

   )

)

Usage example:

  • Get all questions dependencies for Survey $sid and group $gid indexed by depqid: $result=getQuestDepsForConditions($sid,$gid);
  • Get all questions dependencies for question $qid in survey/group $sid/$gid indexed by depqid: $result=getGroupDepsForConditions($sid,$gid,$qid);
  • Get all questions dependents on question $qid in survey/group $sid/$gid indexed by targqid: $result=getGroupDepsForConditions($sid,$gid,"all",$qid,"by-targgid");

« More »

getQuestionAttributeValue

Returns the questionAttribtue value set or '' if not set

package

Default

author

: lemeur

Arguments

$questionAttributeArray

$attributeName

string

$language

string Optional: The language if the particualr attributes is localizable

Response

string

« More »

getQuestionClass

getQuestionClass() returns a class name for a given question type to allow custom styling for each question type.

package

Default

Arguments

$input

string

containing unique character representing each question type.

Response

string

containing the class name for a given question type.

« More »

getQuestionMapData

Return data to populate a Google Map

package

Default

Arguments

$sField

string

$qsid

Survey id

Response

array

« More »

getQuestionMapData

Return data to populate a Google Map

package

Default

Arguments

$sField

string

$qsid

Survey id

Response

array

« More »

getQuestionTypeList

getQuestionTypeList() Returns list of question types available in LimeSurvey. Edit this if you are adding a new question type

package

Default

Arguments

$SelectedCode

string

Value of the Question Type (defaults to "T")

$ReturnType

string

Type of output from this function (defaults to selector)

Response

array|string

depending on $ReturnType param, returns a straight "array" of question types, or an list

Explanation of questiontype array:

description : Question description subquestions : 0= Does not support subquestions x=Number of subquestion scales answerscales : 0= Does not need answers x=Number of answer scales (usually 1, but e.g. for dual scale question set to 2) assessable : 0=Does not support assessment values when editing answerd 1=Support assessment values

« More »

getRadixPointData

Returns avaliable formats for Radix Points (Decimal Separators) or returns radix point info about a specific format.

@param int $format Format ID/Number [optional]

package

Default

Arguments

$format

« More »

getReferringUrl

GetReferringUrl() returns the referring URL

package

Default

Response

string

« More »

getRenderWay

Returns which way should be rendered

package

Default

Arguments

$renderToken

string

$renderCaptcha

string

Response

string

« More »

getSavedCount

This function returns a count of the number of saved responses to a survey

package

Default

Arguments

$surveyid

mixed

Survey ID

« More »

getSerialClass

package

Default

Arguments

$sSerial

string

Response

string|null

« More »

getSideBodyClass

Get the margin class for side-body div depending on side-menu behaviour config and page (edit or not etc).

package

Default

Throws
\CException

Arguments

$sideMenustate

boolean

  • False for pages with collapsed side-menu

Response

string

« More »

getStandardsReplacementFields

package

Default

Arguments

$thissurvey

« More »

getSubQuestions

Return an array of subquestions for a given sid/qid

package

Default

Arguments

$sid

integer

$qid

integer

$sLanguage

string

Language of the subquestion text

Response

array

« More »

getSurveyDefaultSettings

package

Default

« More »

getSurveyInfo

Gets all survey infos in one big array including the language specific settings

package

Default

Arguments

$surveyid

integer

The survey ID

$languagecode

string

The language code - if not given the base language of the particular survey is used

Response

array|boolean

Returns array with survey info or false, if survey does not exist

« More »

getSurveyList

getSurveyList() Queries the database (survey table) for a list of existing surveys

package

Default

Arguments

$bReturnArray

boolean

If set to true an array instead of an HTML option list is given back

Response

string|array

This string is returned containing formatted list of existing surveys

« More »

getSurveyUserGroupList

Return HTML <option> list of user groups

package

Default

Arguments

$outputformat

string

$surveyid

integer

Response

string|array

« More »

getSurveyUserList

Retrieve a HTML <OPTION> list of survey admin users

package

Default

Arguments

$bIncludeSuperAdmins

boolean

If Super admins should be included

$surveyid

integer

Response

string

« More »

getTemplateList

package

Default

« More »

getTemplatePath

This function returns the complete directory path to a given template name

package

Default

Arguments

$sTemplateName

mixed

Response

string

« More »

getTemplateURL

This function returns the complete URL path to a given template name

package

Default

Arguments

$sTemplateName

mixed

Response

string

« More »

getTokenFieldsAndNames

Retrieves the attribute names from the related survey participants table

package

Default

Arguments

$surveyid

mixed

The survey ID

$bOnlyAttributes

boolean

Set this to true if you only want the fieldnames of the additional attribue fields - defaults to false

Response

array

The fieldnames as key and names as value in an Array

« More »

getUserGroupList

Get a list of all user groups

package

Default

returns

array

« More »

getUserList

package

Default

Arguments

$outputformat

« More »

getXMLDataSingleTable

Exports a single table to XML

package

Default

Arguments

$iSurveyID

integer

The survey ID

$sTableName

string

The database table name of the table to be export

$sDocType

string

What doctype should be written

$sXMLTableTagName

string

Name of the tag table name in the XML file

$sFileName

$bSetIndent

Response

string|boolean

XMLWriter object

« More »

getXMLWriter

Wrapper function to retrieve an xmlwriter object and do error handling if it is not compiled into PHP

package

Default

« More »

group_export

package

Default

Arguments

$action

string

$iSurveyID

$gid

« More »

groupGetXMLStructure

package

Default

Arguments

$xml

\XMLWriter

$gid

« More »

groupOrderThenQuestionOrder

Compares two elements from an array (passed by the usort function) and returns -1, 0 or 1 depending on the result of the comparison of the sort order of the group_order and question_order field

package

Default

Arguments

$a

mixed

$b

mixed

Response

integer

« More »

gT

Translation helper function

package

Default

Arguments

$sToTranslate

string

$sEscapeMode

string

Valid values are html (this is the default, js and unescaped)

$sLanguage

string

Response

mixed|string

« More »

hasFileUploadQuestion

Returns true if the given survey has a File Upload Question Type

package

Default

Arguments

$iSurveyID

integer

Response

boolean

« More »

hasResources

put your comment there.

..

package

Default

Arguments

$id

integer

$type

string

Response

boolean

« More »

hasTemplateManageRights

package

Default

Arguments

$userid

$sThemeFolder

« More »

HTMLEscape

package

Default

Arguments

$str

« More »

humanFilesize

Format size in human readable format.

package

Default

Arguments

$bytes

integer

$decimals

integer

Response

string

« More »

ignore

package

Default

Arguments

$entry

« More »

importSurveyFile

package

Default

Arguments

$sFullFilePath

string

$bTranslateLinksFields

boolean

$sNewSurveyName

string

$DestSurveyID

integer

« More »

includeKeypad

Include Keypad headers

package

Default

« More »

incompleteAnsFilterState

This function return actual completion state

package

Default

Response

string|boolean

(complete|incomplete|all) or false

« More »

initFieldArray

package

Default

Arguments

$surveyid

integer

$fieldmap

array

« More »

initKcfinder

package

Default

« More »

injectglobalsettings

package

Default

« More »

insertlabelset

package

Default

« More »

is_template_editable

This function checks if a certain template may be by modified, copied, deleted according to the settings in config.php

package

Default

Arguments

$templatename

mixed

« More »

isCaptchaEnabled

isCaptchaEnabled($screen, $usecaptchamode)

package

Default

Arguments

$screen

string

  • the screen name for which to test captcha activation

$captchamode

Response

boolean|null

  • returns true if captcha must be enabled

« More »

isNumericExtended

Returns true if passed $value is numeric

package

Default

Arguments

$value

Response

boolean

« More »

isNumericInt

Check if $str is an integer, or string representation of an integer

package

Default

Arguments

$mStr

string

Response

boolean|integer

« More »

isStandardTemplate

isStandardTemplate returns true if a template is a standard template This function does not check if a template actually exists

package

Default

Arguments

$sTemplateName

mixed

template name to look for

Response

boolean

True if standard template, otherwise false

« More »

isTokenCompletedDatestamped

package

Default

Arguments

$thesurvey

« More »

iterateList

package

Default

Arguments

$i

\Iterator

« More »

javascriptEscape

package

Default

Arguments

$str

$strip_tags

$htmldecode

« More »

json_decode_ls

Decode a json string, sometimes needs stripslashes

package

Default

Arguments

$jsonString

string

Response

mixed

« More »

killSurveySession

killSurveySession : reset $_SESSION part for the survey

package

Default

Arguments

$iSurveyID

integer

« More »

languageDropdown

package

Default

Arguments

$surveyid

$selected

« More »

languageDropdownClean

Creates a <select> HTML element for language selection for this survey

package

Default

Arguments

$surveyid

integer

$selected

string

The selected language

Response

string

« More »

ldap_bindCnx

package

Default

Arguments

$ds

$server_id

« More »

ldap_doTokenSearch

package

Default

Arguments

$ds

$ldapq

$ResArray

$surveyid

integer

« More »

ldap_getCnx

package

Default

Arguments

$server_id

« More »

ldap_readattr

package

Default

Arguments

$attr

« More »

ldap_search_withScope

package

Default

Arguments

$ds

mixed

$basedn

mixed

$filter

mixed

$attrlist

mixed

$scope

mixed

« More »

loadanswers

package

Default

« More »

longestString

longestString() returns the length of the longest string past to it.

package

Default

peram

string $new_string

integer $longest_length length of the (previously) longest string passed to it.

Arguments

$new_string

$longest_length

integer

Response

integer

representing the length of the longest string passed (updated if $new_string was longer than $longest_length)

usage should look like this: $longest_length = longestString( $new_string , $longest_length );

« More »

LS

LS Library autoloader

package

Default

Arguments

$class

string

« More »

ls_json_encode

Must use ls_json_encode to json_encode content, otherwise LimeExpressionManager will think that the associative arrays are expressions and try to parse them.

package

Default

Arguments

$content

« More »

mandatory_message

package

Default

Arguments

$ia

« More »

mandatory_popup

package

Default

Arguments

$ia

$notanswered

« More »

mkdir_p

package

Default

Arguments

$target

string

« More »

modifyDatabase

Run an arbitrary sequence of semicolon-delimited SQL commands

Assumes that the input text (file or string) consists of a number of SQL statements ENDING WITH SEMICOLONS. The semicolons MUST be the last character in a line. Lines that are blank or that start with "#" or "--" (postgres) are ignored. Only tested with mysql dump files (mysqldump -p -d limesurvey) Function kindly borrowed by Moodle

package

Default

Arguments

$sqlfile

string

The path where a file with sql commands can be found on the server.

$sqlstring

string

If no path is supplied then a string with semicolon delimited sql commands can be supplied in this argument.

Response

boolean

Returns true if database was modified successfully.

« More »

modifyPrimaryKey

Modifies a primary key in one command - this is only tested on MySQL

package

Default

Arguments

$sTablename

string

The table name

$aColumns

array<mixed,string>

Column names to be in the new key

« More »

modlabelsetanswers

package

Default

Arguments

$lid

null|integer

« More »

mssql_drop_constraint

package

Default

Arguments

$fieldname

string

$tablename

string

« More »

mssql_drop_primary_index

package

Default

Arguments

$tablename

string

« More »

neT

Translation helper function for plural forms which outputs right away

package

Default

Arguments

$sToTranslate

string

$iCount

integer

$sEscapeMode

string

« More »

ngT

Translation helper function for plural forms

package

Default

Arguments

$sTextToTranslate

string

$iCount

integer

$sEscapeMode

string

Response

string

« More »

nice_addslashes

package

Default

Arguments

$string

« More »

numericSize

Find the numeric size according DB size for existing question for SPSS export Column name must be SGQA currently

package

Default

Arguments

$sColumn

Response

string

integersize.decimalsize

« More »

outputDatabase

Outputs a full dump of the current LimeSurvey database

package

Default

Arguments

$sDbName

string

Database Name

$bEchoOutput

$sFileName

« More »

PassthruReplace

passthruReplace() takes a string and looks for {PASSTHRU:myarg} variables which it then substitutes for parameter data sent in the initial URL and stored in the session array containing responses

package

Default

Arguments

$line

mixed

string - the string to iterate, and then return

$thissurvey

mixed

string - the string containing the surveyinformation

Response

string

This string is returned containing the substituted responses

« More »

pr

package

Default

Arguments

$msg

« More »

prefillFromCommandLine

Prefill startvalues from command line param

package

Default

Arguments

$surveyid

integer

« More »

PrepareEditorScript

package

Default

Arguments

$load

$controller

\CController

« More »

prepareLDAPQuery

package

Default

Arguments

$queryId

« More »

questionExport

package

Default

Arguments

$action

string

$iSurveyID

$gid

$qid

« More »

questionGetXMLStructure

package

Default

Arguments

$xml

\XMLWriter

$gid

$qid

« More »

quexml_create_multi

from export_structure_quexml.php

package

Default

Arguments

$question

$qid

$varname

$iResponseID

$fieldmap

$scale_id

$free

$other

$yesvalue

« More »

quexml_create_question

Create a queXML question element

package

Default

Arguments

$RowQ

array

Question details in array

$additional

boolean|string

Any additional question text to append

« More »

quexml_create_subQuestions

from export_structure_quexml.php

package

Default

Arguments

$question

$qid

$varname

$iResponseID

$fieldmap

$use_answers

$aid

$scale

« More »

quexml_export

Export quexml survey.

package

Default

Arguments

$surveyi

$quexmllan

$iResponseID

« More »

quexml_get_lengthth

from export_structure_quexml.php

package

Default

Arguments

$qid

$attribute

$default

$quexmllang

« More »

quexml_set_default_value

Set defaultValue attribute of provided element from response table

package

Default

Arguments

$element

mixed

DOM element to add attribute to

$iResponseID

integer

The response id

$qid

integer

The qid of the question

$iSurveyID

integer

The survey id

$fieldmap

array

A mapping of fields to qid

$fieldadd

boolean|string

Anything additional to search for in the field name

$usesqid

boolean|string

Search using sqid instead of qid

$usesaid

boolean|string

Search using aid

$usesscale

« More »

QueXMLCleanup

from export_structure_quexml.php

package

Default

Arguments

$string

$allow

« More »

QueXMLCreateFixed

from export_structure_quexml.php

package

Default

Arguments

$qid

$iResponseID

$fieldmap

$rotate

$labels

$scale

$other

$varname

« More »

QueXMLCreateFree

from export_structure_quexml.php

package

Default

Arguments

$f

$len

$lab

« More »

QueXMLFixedArray

from export_structure_quexml.php

package

Default

Arguments

$array

« More »

QueXMLSkipTo

Calculate if this item should have a QueXMLSkipTo element attached to it

from export_structure_quexml.php

package

Default

author

Adam Zammit adam.zammit@acspri.org.au

since 2010-10-28
TODO

Correctly handle conditions in a database agnostic way

Arguments

$qid

mixed

$value

mixed

$cfieldname

Response

boolean|string

Text of item to skip to otherwise false if nothing to skip to

« More »

quoteText

Quotes a translation according to purpose if sEscapeMode is null, we use HTML method because probably we had to specify null as sEscapeMode upstream

package

Default

Arguments

$sText

mixed

Text to quote

$sEscapeMode

string

Optional - One of the values 'html','js' or 'unescaped' - defaults to 'html'

Response

mixed|string

« More »

randomChars

Creates a random sequence of characters

package

Default

Arguments

$length

integer

Length of resulting string

$pattern

string

To define which characters should be in the resulting string

Response

string

« More »

randomizationGroup

Randomization group for groups

package

Default

Arguments

$surveyid

integer

$fieldmap

array

$preview

boolean

Response

array

($fieldmap, $randomized)

« More »

randomizationGroupsAndQuestions

Apply randomizationGroup and randomizationQuestion to session fieldmap

package

Default

Arguments

$surveyid

integer

$preview

boolean

$fieldmap

« More »

randomizationQuestion

Randomization group for questions

package

Default

Arguments

$surveyid

integer

$fieldmap

array

$preview

boolean

Response

array

($fieldmap, $randomized)

« More »

recursive_in_array

package

Default

Arguments

$needle

$haystack

« More »

regenerateCSRFToken

Force Yii to create a new CSRF token by removing the old one

package

Default

« More »

removeBOM

This function removes the UTF-8 Byte Order Mark from a string

package

Default

Arguments

$str

string

Response

string

« More »

renderError

package

Default

Arguments

$sTitle

$sMessage

$thissurvey

$sTemplateViewPath

string

« More »

renderRenderWayForm

Render token, captcha or register form

package

Default

Arguments

$renderWay

string

$scenarios

array

$sTemplateViewPath

string

$aEnterTokenData

array

$surveyid

integer

« More »

replaceExpressionCodes

Replaces EM variable codes in a current survey with a new one

package

Default

Arguments

$iSurveyID

integer

The survey ID

$aCodeMap

mixed

The codemap array (old_code=>new_code)

« More »

ReplaceFields

package

Default

Arguments

$text

$fieldsarray

$bReplaceInsertans

$staticReplace

« More »

resetAllSessionVariables

Resets all session variables for this survey

package

Default

Arguments

$surveyid

integer

« More »

resetTimers

Resets all question timers by expiring the related cookie - this needs to be called before any output is done

package

Default

todo

Make cookie survey ID aware

« More »

resetTutorials337

package

Default

Arguments

$oDB

\CDbConnection

« More »

retrieveAnswers

This function returns an array containing the "question/answer" html display and a list of the question/answer fieldnames associated. It is called from question.php, group.php, survey.php or preview.php

package

Default

Arguments

$ia

array

Details of $ia can be found at top of this file

Response

array

Array like [array $qanda, array $inputnames] where $qanda has elements [ $qtitle (question_text) : array [ all : string; complete HTML?; all has been added for backwards compatibility with templates that use question_start.pstpl (now redundant) 'text' => $qtitle, question?? $ia[3]? 'code' => $ia[2] or title?? 'number' => $number 'help' => '' 'mandatory' => '' man_message : string; message when mandatory is not answered 'valid_message' => '' file_valid_message : string; only relevant for file upload 'class' => '' 'man_class' => '' 'input_error_class' => '' // provides a class. 'essentials' => '' ] $answer ? 'help' : string $display : ? $qid : integer $ia[2] = title; $ia[5] = group id : int $ia[1] = fieldname : string ] and $inputnames is ? used for hiddenfieldnames and upload file?

« More »

return_array_filter_strings

package

Default

Arguments

$ia

$aQuestionAttributes

$thissurvey

$ansrow

$rowname

string

$trbc

$valuename

string

$method

$class

« More »

return_display_style

package

Default

Arguments

$ia

$aQuestionAttributes

$thissurvey

$rowname

string

« More »

return_timer_script

package

Default

Arguments

$aQuestionAttributes

$ia

$disable

string

Response

string

« More »

returnGlobal

This function returns POST/REQUEST vars, for some vars like SID and others they are also sanitized TODO: extends Yii:getParam

package

Default

Arguments

$stringname

string

$bRestrictToString

boolean

Response

array|boolean|mixed|integer|null

« More »

reverseTranslateFieldNames

This function creates the old fieldnames for survey import

package

Default

Arguments

$iOldSID

mixed

The old survey id

$iNewSID

integer

The new survey id

$aGIDReplacements

array

An array with group ids (oldgid=>newgid)

$aQIDReplacements

array

An array with question ids (oldqid=>newqid)

Response

array|boolean

« More »

rmdirr

This function removes a directory recursively

package

Default

Arguments

$dirname

string

Response

boolean

« More »

rollBackToTransactionBookmark

Roll back to a transaction bookmark

package

Default

Arguments

$sBookmark

mixed

Name of the bookmark

« More »

safeDie

Provides a safe way to end the application

package

Default

returns

boolean Fake return so Scrutinizes shuts up

Arguments

$sText

mixed

« More »

sanitize

package

Default

Arguments

$input

$flags

$min

$max

« More »

sanitize_cquestions

package

Default

Arguments

$string

$min

$max

« More »

sanitize_dirname