LimeSurvey API - Master branch

CoreQuestionAttributeProvider extends QuestionAttributeProvider
in package

Provides question attribute definitions from question types

Table of Contents

Methods

getDefinitions()  : array<string, array<string|int, mixed>>
Returns question attribute definitions for the specified options from one source
getAdvancedAttributesFromXml()  : array<string, array<string|int, mixed>>
Read question attributes from XML file and convert it to array
getBaseDefinition()  : array<string, mixed>
Get default settings for an attribute, return an array of string|null
getGeneralAttibutesFromXml()  : array<string, array<string|int, mixed>>
Read question attributes from XML file and convert it to array
getQuestionAttributes()  : array<string, array<string|int, mixed>>
Return the question attribute settings for the passed type (parameter)
getQuestionType()  : mixed
Extracts the question type from the $options.

Methods

getDefinitions()

Returns question attribute definitions for the specified options from one source

public getDefinitions([mixed $options = [] ]) : array<string, array<string|int, mixed>>
Parameters
$options : mixed = []

to use

Tags
inheritdoc
Return values
array<string, array<string|int, mixed>>

array of question attribute definitions

getAdvancedAttributesFromXml()

Read question attributes from XML file and convert it to array

protected getAdvancedAttributesFromXml(string $xmlFilePath) : array<string, array<string|int, mixed>>
Parameters
$xmlFilePath : string

Path to XML

Return values
array<string, array<string|int, mixed>>

The advanced attribute settings for this question type

getBaseDefinition()

Get default settings for an attribute, return an array of string|null

protected static getBaseDefinition() : array<string, mixed>
Return values
array<string, mixed>

getGeneralAttibutesFromXml()

Read question attributes from XML file and convert it to array

protected getGeneralAttibutesFromXml(string $xmlFilePath) : array<string, array<string|int, mixed>>
Parameters
$xmlFilePath : string

Path to XML

Return values
array<string, array<string|int, mixed>>

The general attribute settings for this question type

getQuestionAttributes()

Return the question attribute settings for the passed type (parameter)

protected getQuestionAttributes(string $questionType[, bool $advancedOnly = false ]) : array<string, array<string|int, mixed>>
Parameters
$questionType : string

: type of question (this is the attribute 'question_type' in table question_theme)

$advancedOnly : bool = false

If true, only fetch advanced attributes

Tags
throws
CException
Return values
array<string, array<string|int, mixed>>

the attribute settings for this question type returns values from getGeneralAttributesFromXml and getAdvancedAttributesFromXml if this fails getAttributesDefinition and getDefaultSettings are returned

getQuestionType()

Extracts the question type from the $options.

protected static getQuestionType(array<string, mixed> $options) : mixed

If it's not explicitly set, it tries to use a question object.

Parameters
$options : array<string, mixed>

        
On this page

Search results