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
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
Response
string
(or false)
Returns the short answer for the question.
getShortAnswer(string $sFieldName,string $sValue): string
Arguments
Response
string
Properties
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]
Type(s)
array<mixed,integer>|array<mixed,string>|array<mixed,mixed>
The fieldMap as generated by createFieldMap(.
fieldMap :\array[]mixed
The groups in the survey.
groups :array<mixed,integer>|array<mixed,string>|array<mixed,mixed>
Type(s)
array<mixed,integer>|array<mixed,string>|array<mixed,mixed>
info about the survey
info :array
The questions in the survey.
questions :array<mixed,integer>|array<mixed,string>|array<mixed,mixed>
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
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]
Type(s)
array<mixed,integer>|array<mixed,string>|array<mixed,mixed>
languageSettings
languageSettings :array<mixed,integer>|array<mixed,string>|array<mixed,mixed>
Type(s)
array<mixed,integer>|array<mixed,string>|array<mixed,mixed>