#ELEMENT:CHOICE

#ELEMENT:CHOICE

Used to create ITEMS of type RADIO BUTTON or CHECK BOX, which contain a list of options that the user can select

TITLEDATA_CODEQUESTION TYPECOMMENTS
Title of QuestionTITLETEXT AREAThis is the text to be shown when the FORM is not being edited
Title of Question on edit TITLE_ON_EDITTEXT AREAThis is the text to be shown when the FORM is being edited (the user is answering the question)
Question typeID_TIPO_PREGUNTA

VERTICAL_RADIO


Required?OBLIGATORIO_SNBOOLEAN
Monitoring Report?INFORME_SEGUIMIENTO_SNBOOLEAN
FormulaFORMULATEXT
Default valueVALOR_POR_DEFECTOTEXT
TabulationTABULACIONNUMERICAL
ConditionCONDICIONTEXT
Visibility conditionVISIBILITY_CONDITIONTEXTCondition to determine whether this ITEM can be viewed by the active USER or not. In run-time, if this condition evaluates to 'false' then the ITEM will not be returned by API functions like form_get_summary() (but it is still considered to exist in the FORM)
Number of associated questionsNUM_ASOCIADASNUMERICAL
DatacodeDATA_CODETEXT
HiddenHIDDENVERTICAL_RADIO
Automatic optionsOPTIONSTEXT

Title format

LITERAL_FORMATJSONFormat attributes for the TITLE. For information about the contents of the JSON see FORM TEMPLATE OBJECT#LITERAL_FORMAT
Answer formatVALUE_FORMATJSONFormat attributes for the value. For information about the contents of the JSON see FORM TEMPLATE OBJECT#LITERAL_FORMAT
ArrangementARRANGEMENTJSONAttributes to define the arrangement of the question & answer in the screen. For information about the contents of the JSON see FORM TEMPLATE OBJECT#ARRANGEMENT_FORMAT
Images


ARRAY OF 2 QUESTIONImageITEM_IMAGEJSON

Contains a reference to a LIBRARY RESOURCE OBJECT. This is normally used to associate a picture to an ITEM of type RADIO BUTTON or CHECK BOX so that the selection of the options can be done clicking on an image instead of selecting from a list of textual options.

This field must be used in combination with the property OPTION_REGION, which contains the definition of the region of the image that corresponds to the selected option (see below the properties of OPTIONS)

To get further information about the format of the JSON string see LIBRARY RESOURCE INFO (JSON)

FormulaITEM_IMAGE_FORMULATEXT

Allows to define a FORMULA that will be used to calculate the reference of the IMAGE associated to this ITEM. If the evaluation of the FORMULA returns NULL or an invalid image reference, then the default image uploaded in the property ITEM_IMAGE will be used.

IMPORTANT: The FORMULA should return a reference to the image, no the image bytes.

Example of valid FORMULA:

ITEM{4}.ANSWER{IMAGE_REF]


Introduced in API Version 2.7.20

Order of imageITEM_IMAGE_ORDERNUMERICAL
Options

Array of available options
ARRAY OF 6 QUESTIONSReference of optionOPTION_REFNUMERICAL

READ ONLY: This value is generated automatically.

A unique reference value for each of the OPTIONs defined in the ITEM

Text of optionOPTION_TITLETEXT
Value of optionOPTION_VALUETEXT
Order of optionOPTION_ORDERNUMERICAL
Image associated to optionOPTION_IMAGEJSON

Contains a reference to a LIBRARY RESOURCE OBJECT. This is normally used to associate a picture to an option so that it can be graphically presented in the user interface instead of only displaying a text.

To get further information about the format of the JSON string see LIBRARY RESOURCE INFO (JSON)

Definition of a region in one of the IMAGES associated to the ITEMOPTION_REGIONJSON

Permits to define a region of one of the images defined in ITEM_IMAGE property. The region is defined as a JSON string with the following structure:

{ "resource_ref" : 2123,
  "region" : "12,35,14,55,90,33, ... ]
}
  • item_image: indicates which of the images defined in the property ITEM_IMAGE is used to define the region that corresponds to this option
  • region: an array of coordinates (x,y) which define a closed polygon that represents the zone of the image associated to this option