/
ITEM TYPE: "EVALUATION"

ITEM TYPE: "EVALUATION"

An “EVALUATION” ITEM type is an ITEM that contains a literal string that represents a FORM FORMULA .

The response of this type of ITEM cannot be set manually (via form_set_answer (). It is set automatically using the properties “FORMULA” or “DEFAULT_VALUE” of an ITEM

When requesting the value of this type of ITEM (form_get_question ( ) , form_get_summary () ), the value returned will be the result of evaluating the string stored as the response of the ITEM.

Example 1

The properties of the ITEM are:

  • FORMULA = null

  • DEFAULT VALUE = 3+2

This ITEM will have no response stored in DB, because the FORMULA property does not return any value, but there exists a default value.

The value returned will be “5” because is the result of evaluating the default value

Example 2

The properties of the ITEM are:

  • FORMULA = “ITEM{$1]” & “ * 2”

  • DEFAULT VALUE = 3+2

The response stored in the ITEM will be the string “ITEM{1} * 2”, which is the result of evaluating the FORMULA property (concatenation of 2 strings).

In this case the default value will be ignored because the FORMULA property generated a non-empty string.

Supposing that the value of ITEM{$1} is 15, the value returned by this type of ITEM would be 30

Related content