Display only those questions that have an answer

package Gems
subpackage Events
copyright Copyright (c) 2012 Erasmus MC
license New BSD License
since Class available since version 1.5.6
inherited_from \Gems_Event_SurveyAnswerFilterAbstract

 Methods

Strip elements from the array that are considered empty

array_filter(\type $inputArray, \type $model) : boolean

Empty is NULL or empty string, values of 0 are NOT empty unless they are a checkbox

Parameters

$inputArray

\type

$model

\type

Returns

boolean

This function is called in addBrowseTableColumns() to filter the names displayed by AnswerModelSnippetGeneric.

filterAnswers(\MUtil_Model_Bridge_TableBridge $bridge, \MUtil_Model_ModelAbstract $model, array $currentNames) : array
see

Parameters

$bridge

\MUtil_Model_Bridge_TableBridge

$model

\MUtil_Model_ModelAbstract

$currentNames

array

The current names in use (allows chaining)

Returns

arrayOf the names of labels that should be shown

Function that returns the snippets to use for this display.

getAnswerDisplaySnippets(\Gems_Tracker_Token $token) : array
Inherited
inherited_from \Gems_Event_SurveyDisplayEventInterface::getAnswerDisplaySnippets()

Parameters

$token

\Gems_Tracker_Token

The token to get the snippets for

Returns

arrayof Snippet names or nothing

A pretty name for use in dropdown selection boxes.

getEventName() : string

Returns

stringName

Returns only the headers

getHeaders(\MUtil_Model_ModelAbstract $model, array $currentNames) : array
Inherited

Parameters

$model

\MUtil_Model_ModelAbstract

$currentNames

array

The current names in use (allows chaining)

Returns

arrayOf the names of labels that should be shown

Restores the header position of question before their corresponding question_sub

restoreHeaderPositions(\MUtil_Model_ModelAbstract $model, array $currentNames) : array
Inherited

When sub-questions with the same parent are shown continuous the parent is shown once before them. When the sub-questions are displayed in seperate groups the parent is shown once at their start.

Stand alone headers without any corresponding value are removed. When they do have a value of their own they are still shown, but their position may change according to their sub-questions position. (NOTE: As in LimeSurvey their are no question headers with values we leave it at this for the moment.)

Parameters

$model

\MUtil_Model_ModelAbstract

$currentNames

array

The current names in use (allows chaining)

Returns

arrayOf the names of labels that should be shown

 Properties

 

$locale

$locale : \Zend_Locale

Default

 

$token

$token : \Gems_Tracker_Token

Default