Button with click validation
If a task requires a performer to click a link (for example, to open a webpage), Toloka can check if the performer did it. The link is displayed in the task as a button.
Variations of button use:
-
Checking if the user followed the link. The output data will contain a field with values
true
(the user followed the link) orfalse
(the user didn't follow the link). -
Preventing the user from completing the task if the link was not opened. Add the
"allowed_values":[true]
parameter in the output data description.
To add the button with the link to the task interface, use the {{field type="button-clicked" name="<field ID>"}}
component. Field ID must match the field name in the output data description. For example:
{{field type="button-clicked" name="ads" label="Click me" href="https://yandex.ru" action=true}}
-
action=true
— Yellow. -
action=false
— White. -
action=true
— Yellow. -
action=false
— White.
Parameter | Description | Required | Default value |
---|---|---|---|
| Field type: | yes | no |
| Field ID. Must match the field name in the output data description. | yes | no |
label | The button label. For example, label="Click me" . | no | no |
href | URL that the performer must open to complete the task. | no | no |
| Size of the field. Supported values: | no |
|
| Button color: | no |
|
Parameter | Description | Required | Default value |
---|---|---|---|
| Field type: | yes | no |
| Field ID. Must match the field name in the output data description. | yes | no |
label | The button label. For example, label="Click me" . | no | no |
href | URL that the performer must open to complete the task. | no | no |
| Size of the field. Supported values: | no |
|
| Button color: | no |
|
Add a field of boolean
type to the output data description. To prevent the user from sending responses without opening the link, add the "allowed_values":[true]
parameter.
{
"ads": {
"type": "boolean",
"required": true,
"allowed_values": [true]
}
}