QuestionBase

Implements \ls\pluginmanager\iQuestion

Methods

__construct

__construct(\ls\pluginmanager\iPlugin $plugin, \ls\pluginmanager\LimesurveyApi $api, int $questionId = null, int $responseId = null) 

Arguments

$plugin

\ls\pluginmanager\iPlugin

The plugin to which this question belongs.

$questionId

int

$responseId

int

Pass a response id to load results.

This function retrieves question data. Do not cache this data; the plugin storage engine will handling caching. After the first call to this function, subsequent calls will only consist of a few function calls and array lookups.

get(string $key = null, mixed $default = null, string $language = null, int $questionId = null) : boolean

Arguments

$key

string

String identifier for data.

$default

mixed

Default value.

$language

string

Language to retrieve.

$questionId

int

By default uses the question id for the current instance. Override this to read from another question.

Response

boolean

Gets the meta data for question attributes.

getAttributes(\ls\pluginmanager\type $languages = null) : \ls\pluginmanager\type

Optionally pass one or more languages to also get current values. Pass * to get all stored languages.

Arguments

$languages

\ls\pluginmanager\type

Response

\ls\pluginmanager\type

getColumns

getColumns() 

getCount

getCount() 

This function derives a unique identifier for identifying a question type.

getGUID() 
static

Gets the response for the current response id.

getResponse() : \ls\pluginmanager\type

Response

\ls\pluginmanager\type

getVariables

getVariables() 

Load the question data from the questions model.

loadSubQuestions(integer $questionId) 

Arguments

$questionId

integer

saveAttributes

saveAttributes(array $attributeValues, $qid = null) 

Arguments

$attributeValues

array

$qid

This function saves question data.

set(string $key, mixed $value, string $language = null, $questionId = null) : boolean

Arguments

$key

string

$value

mixed

$language

string

$questionId

Response

boolean

Properties

api

api : \ls\pluginmanager\LimesurveyApi

Array containing meta data for supported question attributes.

attributes : array
var

Type(s)

array

Array containing an array for each column.

columns : array

The supported keys for column meta data are: - type - name - description

var

Type(s)

array

Array containing attributes that all question types share.

defaultAttributes : array
var

Type(s)

array

Array containing default attributes that are merged into the attribute arrays.

defaultAttributeProperties : array
var

Type(s)

array

info

info : 
static

plugin

plugin : \ls\pluginmanager\iPlugin

The question id for this question object instance.

questionId : int
var

The question id for this question object instance.

Type(s)

int

The response id for this question object instance.

responseId : int
var

The response id for this question object instance.

Type(s)

int

Contains the subquestion objects for this question.

subQuestions : \ls\pluginmanager\iQuestion[]
var

Type(s)

\ls\pluginmanager\iQuestion[]

The signature array is used for deriving a unique identifier for a question type.

signature : array
static

After initial release the contents of this array may NEVER be changed. Changing the contents of the array will identify the question object as a new question type and will break many if not all existing surveys.

  • Add more keys & values to make it more unique.
var

Type(s)

array