Common attributes
- label
- Every CML base tag (along with the
cml:checkboxandcml:radiochild tags) can have alabelattribute. This will be displayed next to the generated form element. If nonameattribute is specified on a base tag, this will be converted into a name by removing alpha-numeric characters and replacing spaces with an underscore. - name
- Every CML base tag (except
cml:group) along with thecml:checkboxandcml:radiochild tags can have anameattribute. This must be unique across all base tags. The name should not contain capital letters, spaces, or non alpha-numeric characters. This will become a column header in your generated CSV. - value
- The primary use for this attribute is setting
cml:hiddentag values. In the case ofcml:option,cml:checkboxandcml:radio,labelwill become thevalueif none is specified. If you want to have a default value forcml:textorcml:textarea, we suggest using thedefaultattribute as this provides a better experience for the user. - default
- When specified on
cml:select, it must be the label name of the option that will be selected by default. When used oncml:textreaorcml:text, this provides an example input for the user and disappears once the user selects the form element. Default values will not be submitted. - instructions
- Every CML base tag can have an
instructionsattribute. This will be displayed next to the generated form element to help clarify the desired input. If both aninstructionsattribute and a<cml:instructions />tag is specified, only the value of the attribute will be used. - only-if
- Every CML base tag can have an
only-ifattribute. The value of this attribute should be the name of the field a user must complete before this field or group of fields will be displayed. See logic for more details. - validates
- Every CML base tag can have a
validatesattribute. This attribute enforces the specified validations to occur on this form element. See validations for more details. - aggregation
- Every CML base tag can have an
aggregationattribute. This attribute tells us how to aggregate your data once it has been collected. The value of this attribute can currently beavg,agg, orall. See aggregation for more details.
gold attributes
- gold
-
Every CML base tag can have a
goldattribute exceptcml:group. If set to"true"this will link the form element with the data specified in the form_element_name_gold column of your uploaded spreadsheet. If it is not set to “true,” it will link the form element with the column specified. See our gold documentation for more details. - exact
-
The
exactattribute requires that the set of worker responses and the set of gold standard responses for a cml field are identical. This only applies to cml:text/textarea fields withmultiple="true"and cml:checkboxes field. A worker’s responses will not pass gold if they include any item not found in the set of gold responses (e.g., ifa,b, andcare set in your gold data, then a worker will only be correct if he submitsa,b, andc). Order does not matter. Best used with cml:gold. - strict
-
The
strictattribute requires that every response submitted is included in the set of gold standard responses. Unlikeexact, however,strictallows workers to omit responses that are part of the gold set (e.g., ifa,b, andcare set in your gold data, a worker will be considered correct if he submits onlyaandb). Best used with cml:gold. - src
-
The
srcattribute specifies which column in the uploaded data the gold information will be retrieved from. Only necessary when creating Gold from a spreadsheet. Best used with cml:gold. - matcher
-
The matcher attribute allows you to redefine the method by which a worker’s response is evaluated against Gold Standard data. In the absence of the matcher attribute, a worker’s response and the Gold Standard response must match exactly. The Matcher attribute allows for more flexibility. The following property values can be used to affect gold behavior:
-
Property values:
- not - Allows gold creation on what should not be submitted. This works with any input in your form. Example: If 'a' is set as a gold value on field with matcher set to "not", and a worker submits 'a' as a response, the worker will miss the gold unit. Responses are saved in the same way as you would normal gold responses. See our gold documentation for more details.
- range - Specifies a numerical range within a worker's response must fall. You must define a minimum and maximum value, which can be set in the gold digging interface or with a spreadsheet The headers should be formatted as column_name_min and column_name_max). A number validator is recommended.
- address - (usAddress2, ukAddress, frAddress, internationalAddress) - Allows one to create gold on individual components (E.g., the state) of an address. When a worker misses the gold, they will see a message that clearly explains which components they missed. See validations for more details.