Displays the variables and their values to help create a new calculation

To start a new calculation you need to know the exact name of the variables returned by the survey source. This event will show this information and the values for each token it finds.

package Gems
subpackage Events
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.5.1
inherited_from \Gems_Event_EventCalculations

 Methods

Adds value to $results when it is different from the value in $tokenAnswers.

addWhenChanged(string $name, mixed $value, array $results, array $tokenAnswers) : boolean
InheritedStatic

Parameters

$name

string

The name of the values

$value

mixed

The value to compare to

$results

array

The results to add to

$tokenAnswers

array

The answers to compare to

Returns

booleanTrue when the value changed.

Returns the avarage over those $fieldNames values that exist in $tokenAnswers and are integers.

averageInt(array $tokenAnswers, mixed $fieldNames) : float
InheritedStatic

Parameters

$tokenAnswers

array

Array containing the answers

$fieldNames

mixed

An array of those names that should be used or a string that should occur in all names that have to be selected.

Returns

float

Checks all $values for a change against $tokenAnswers as floats

checkFloatChanged(array $values, array $tokenAnswers) : array
InheritedStatic

Parameters

$values

array

$tokenAnswers

array

Returns

arrayThose values that were changed.

Checks all $values for a change against $tokenAnswers as integer

checkIntegerChanged(array $values, array $tokenAnswers) : array
InheritedStatic

Parameters

$values

array

$tokenAnswers

array

Returns

arrayThose values that were changed.

A pretty name for use in dropdown selection boxes.

getEventName() : string

Returns

stringName

Process the data and return the answers that should be changed.

processTokenData(\Gems_Tracker_Token $token) : array

Storing the changed values is handled by the calling function.

inherited_from \Gems_Event_SurveyCompletedEventInterface::processTokenData()

Parameters

$token

\Gems_Tracker_Token

Gems token object

Returns

arrayContaining the changed values

Reverses the code value of an item.

reverseCode(integer $code, integer $min, integer $max) : integer
InheritedStatic

Used when a code can have the values 1 to 5 or 0 to 9 and the reverse outcome should be used, e.g.: 5 = 1, 4 = 2, 3 = 3, 2 = 4, 1 = 5.

Parameters

$code

integer

$min

integer

$max

integer

Returns

integer

Rounds the value with a fixed number of decimals, padding zeros when required.

roundFixed(\numeric $value, integer $decimals = 2) : string
InheritedStatic

Parameters

$value

\numeric

$decimals

integer

Returns

string

Returns the sum over those $fieldNames values that exist in $tokenAnswers and are integers

sumInt(array $tokenAnswers, mixed $fieldNames) : integer
InheritedStatic

Parameters

$tokenAnswers

array

Array containing the answers

$fieldNames

mixed

An array of those names that should be used or a string that should occur in all names that have to be selected.

Returns

integer

Finds those tokenAnswers array keys that contain "fieldNames" in their key.

_arrayFindName(array $tokenAnswers, string $fieldNames) : array
InheritedStatic

Parameters

$tokenAnswers

array

$fieldNames

string

Returns

array