SurveyObj
in package
Table of Contents
Properties
- $answers : array<string|int, int>|array<string|int, string>|array<string|int, mixed>
- Answer, codes, and full text to the questions.
- $fieldMap : array<string|int, array<string|int, mixed>>
- The fieldMap as generated by createFieldMap(...).
- $groups : array<string|int, int>|array<string|int, string>|array<string|int, mixed>
- The groups in the survey.
- $id : int
- $info : array<string|int, mixed>
- info about the survey
- $languageSettings : array<string|int, int>|array<string|int, string>|array<string|int, mixed>
- $questions : array<string|int, int>|array<string|int, string>|array<string|int, mixed>
- The questions in the survey.
- $responses : array<string|int, int>|array<string|int, string>|array<string|int, mixed>
- Stores the responses to the survey in a two dimensional array form.
- $tokenFields : mixed
- When relevant holds the available fields from the survey participants table
Methods
- getAnswers() : mixed
- 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.
- getFullAnswer() : string|null
- 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.
- getShortAnswer() : string|null
- Returns the short answer for the question.
Properties
$answers
Answer, codes, and full text to the questions.
public
array<string|int, int>|array<string|int, string>|array<string|int, mixed>
$answers
= array()
This is used in conjunction with the fieldMap to produce some of the more verbose output in a survey export. array[recordNo][columnName]
$fieldMap
The fieldMap as generated by createFieldMap(...).
public
array<string|int, array<string|int, mixed>>
$fieldMap
$groups
The groups in the survey.
public
array<string|int, int>|array<string|int, string>|array<string|int, mixed>
$groups
$id
public
int
$id
$info
info about the survey
public
array<string|int, mixed>
$info
$languageSettings
public
array<string|int, int>|array<string|int, string>|array<string|int, mixed>
$languageSettings
$questions
The questions in the survey.
public
array<string|int, int>|array<string|int, string>|array<string|int, mixed>
$questions
$responses
Stores the responses to the survey in a two dimensional array form.
public
array<string|int, int>|array<string|int, string>|array<string|int, mixed>
$responses
array[recordNo][fieldMapName]
$tokenFields
When relevant holds the available fields from the survey participants table
public
mixed
$tokenFields
= array()
Methods
getAnswers()
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.
public
getAnswers(int $questionId[, int $scaleId = '0' ]) : mixed
Parameters
- $questionId : int
- $scaleId : int = '0'
Return values
mixed —(or false)
getFullAnswer()
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.
public
getFullAnswer(string $fieldName, string|null $answerCode, Translator $translator, string $sLanguageCode) : string|null
The name of the variable $answerCode is not strictly an answerCode but could also be a comment entered by a participant.
Parameters
- $fieldName : string
- $answerCode : string|null
- $translator : Translator
- $sLanguageCode : string
Return values
string|nullgetShortAnswer()
Returns the short answer for the question.
public
getShortAnswer(string $sFieldName, string|null $sValue) : string|null
Parameters
- $sFieldName : string
- $sValue : string|null