SurveyObj

package

Default

Methods

Returns an array of possible answers to the question. If $scaleId is specified then only answers that match the $scaleId value will be returned. An empty array may be returned by this function if answers are found that match the questionId.

getAnswers(integer $questionId, integer $scaleId = '0') : \array[string]array[string]mixed

Arguments

$questionId

integer

$scaleId

integer

Response

\array[string]array[string]mixed

(or false)

Returns the full answer for the question that matches $fieldName and the answer that matches the $answerCode. If a match cannot be made then false is returned.

getFullAnswer(string $fieldName, string $answerCode, \Translator $translator, string $sLanguageCode) : string

The name of the variable $answerCode is not strictly an answerCode but could also be a comment entered by a participant.

Arguments

$fieldName

string

$answerCode

string

$translator

\Translator

$sLanguageCode

string

Response

string

(or false)

Returns the short answer for the question.

getShortAnswer(string $sFieldName, string $sValue) : string

Arguments

$sFieldName

string

$sValue

string

Response

string

Properties

id

id : integer
var

Type(s)

integer

Answer, codes, and full text to the questions.

answers : array<mixed,integer>|array<mixed,string>|array<mixed,mixed>

This is used in conjunction with the fieldMap to produce some of the more verbose output in a survey export. array[recordNo][columnName]

var

Type(s)

array<mixed,integer>|array<mixed,string>|array<mixed,mixed>

The fieldMap as generated by createFieldMap(.

fieldMap : \array[]mixed

..).

var

Type(s)

\array[]mixed

The groups in the survey.

groups : array<mixed,integer>|array<mixed,string>|array<mixed,mixed>
var

Type(s)

array<mixed,integer>|array<mixed,string>|array<mixed,mixed>

info about the survey

info : array
var

Type(s)

array

The questions in the survey.

questions : array<mixed,integer>|array<mixed,string>|array<mixed,mixed>
var

Type(s)

array<mixed,integer>|array<mixed,string>|array<mixed,mixed>

When relevant holds the available fields from the survey participants table

tokenFields : \array[fieldname][localised
var

description]

Type(s)

\array[fieldname][localised

Stores the responses to the survey in a two dimensional array form.

responses : array<mixed,integer>|array<mixed,string>|array<mixed,mixed>

array[recordNo][fieldMapName]

var

Type(s)

array<mixed,integer>|array<mixed,string>|array<mixed,mixed>

languageSettings

languageSettings : array<mixed,integer>|array<mixed,string>|array<mixed,mixed>
var

Type(s)

array<mixed,integer>|array<mixed,string>|array<mixed,mixed>