This is the readme for version 1 of the timed-categories field plug-in. To learn about version 2, click here. For the main readme, click here.
In version 1 of the timed-categories field plug-in, respondents have a set period of time to select a choice, and if a choice is not selected in time, the field will auto-advance. Learn about the features here.
The field will have a value of the selected choice, or the value of the "pass" choice (discussed more later) if a choice is not selected in time.
Metadata is saved if the field is timed, i.e. if the duration
parameter has a value.
You can retrieve the metadata using the plug-in-metadata() function. Metadata is stored in a space-separated list, and you can retrieve each part using the selected-at() function. For example, if the field "metadata" is a calculate field that uses the plug-in-metadata() function to retrieve the metadata, and you wanted the first item in the metadata list, you can use this expression:
selected-at(${metadata}, 0)
There are two or three items in the metadata list:
0 Time remaining: The time remaining in milliseconds when a choice was selected, or when the respondent left the field. You can use this to determine how long it took for the respondent to select a choice.
1 Timestamp: The Unix time when the respondent when a choice was selected, or when the respondent left the field. This is mainly for internal use, and it is unlikely you will need it.
2 Correct: Only used if the correct
parameter has a value. This has a value of 1
if the choice selected is correct, and 0
otherwise. Alternatively, you can also calculate if the response is correct or not by checking the field value, which is demonstrated in the sample form.
Note: If the field is not timed, then the metadata will simply have a value of 1
if the field was opened (whether or not it was answered), and it will be blank otherwise.
To use this field plug-in as-is, just download the timed-categories.fieldplugin.zip file from this repo, and attach it to your form.
To use with the sample form:
- Download the sample form from this repo.
- Download the crops_list.csv (downloads as ZIP file you can attach directly to your form).
- Download the timed-categories.fieldplugin.zip file from this repo.
- Upload the form to your server with the CSV and ZIP files attached.
You can also check out this sample form, which demonstrates the parameters and other features. In addition to the main data file and the field plug-in, attach this file to this sample form.
All choices in the choice list, except for the last choice, will be choices the respondent can select. Each of those choices will have a column in the field display, and they will be selectable by the respondent using either a keyboard key or by clicking it.
The last choice will not be displayed as a column, and instead it will be the "pass" value. It will be automatically selected if time runs out before a choice is selected. This "pass" choice is needed even if the field is not timed.
The value of each choice will be the keyboard key to press to select that choice. For example, if a choice has a value of e
, then if the respondent presses the "E" key on their keyboard, then that choice will be selected, and the field will auto-advance.
All choice values that are letters should be lowercase (they will be displayed in uppercase in the field, but the choice values themselves need to be lowercase). To set up a choice so it is selected when the spacebar is pressed, give that choice a value of space
(this is demonstrated in field "instructions" the sample form).
All parameters are optional, but they can be used to customize the field plug-in.
These are by far the most common parameters you will use.
Name | Description | Default |
---|---|---|
duration |
How long the respondent has to answer the field until it automatically moves on to the next page. No matter the value of If this is undefined, then the field will be untimed, and the timer will not appear. |
None |
unit |
Unit to be used for the display time. For example, if You can use |
's' |
correct |
If a field has a "correct" value, you can define that in this parameter. If the respondent selects the correct answer, then the selected choice will turn green, and show a checkmark. If they select the wrong answer, the selected choice will turn red, and show an X. That way, the respondent gets instant feedback. The value of this parameter should be the same as the correct choice value, but in quotes. For example, if the correct choice has a value of This parameter is optional, so even if a field has a "correct" value, if you don't want to give immediate feedback, you can simply leave this parameter out. If this parameter is not defined, then the selected choice will turn blue, whether or not it is right. |
None |
These are other parameters you can use in your form, but they are a lot less common. They are also all optional.
Name | Description | Default |
---|---|---|
showtimer |
If this has a value of 0 , then the timer will be hidden (though it will still track the time in the background). |
1 |
hidekeys |
Normally, the keyboard key used to select a choice will appear below the choice label. If this parameter has a value of 1 , then it will not show those keyboard keys. This can be helpful if the form will only be completed on a mobile device, where the correct choice will only be selected by clicking/tapping. |
0 |
allowkeys |
Whether or not keyboard keys can be used to select a choice. If this parameter has a value of 0 , then keyboard keys cannot be used to select a choice, only clicking/tapping. It will also hide the keyboard keys usually shown below the choice labels, since they are not needed. |
1 |
allowclick |
Whether or not clicking/tapping a choice on the choice column can be used to select a choice. If this parameter has a value of 0 , then clicking/tapping the choice cannot be used to select a choice, only keyboard keys. |
1 |
continue |
Whether or not the respondent can continue with the time they have left. For example, if the field plug-in has a If this parameter has a value of This parameter has no effect if the |
1 |
allowchange |
Related to If this parameter has a value of This parameter has no effect if the |
1 |
frame_adjust (advanced) |
The field plug-in has been formatted so the tappable area takes up as much of the screen as possible, but without making it so big that the page becomes scrollable. If you would like to make the clickable area bigger or smaller, use this parameter to define how many pixels it should be adjusted by. For example, to make the clickable area 50 pixels taller, give this parameter a value of 50 . To make the clickable area 10 pixels shorter, give this parameter a value of -10 . |
0 |
For a demonstration of the parameters, deploy this sample form, with the data file, this file. and the timed-categories field plug-in attached.
- If the form is going to be completed as a web form, for the Collect settings, you may want to set Disable swipe navigation to ON. That way, if the respondent's finger slips while completing the form on mobile, they will not accidentally swipe backwards to the last field. To adjust web form settings, on the Collect tab of your server console, go to the form, and click Settings.
- You can use the "randomized" appearance to randomize the order of the choice columns. However, the last choice in the choice list is always going to be the "pass" value, and not appear as a column. To make sure the last choice is always last, use the
randomized(0, 1)
appearance. - If you are going to use a
unit
other than seconds, it is a good idea to tell the respondent before they start the test, so they are prepared, and they can focus on the test. - If you do not like the size of the timer circle, the colors, or something else, you can change the field plug-in files. Check out our guide on customizations.
Feature / Property | Support |
---|---|
Supported field type(s) | select_one |
Default values | No |
Custom constraint message | No |
Custom required message | No |
Read only | Yes |
media:image | Yes |
media:audio | Yes |
media:video | Yes |
label appearance |
No |
list-nolabel appearance |
No |
quick appearance |
No |
minimal appearance |
No |
compact appearance |
No |
compact-# appearance |
No |
quickcompact appearance |
No |
quickcompact-# appearance |
No |
likert appearance |
No |
likert-min appearance |
No |
likert-mid appearance |
No |
-
Sample form 1
You can find the main form definition here. You will also need the crops_list.csv file. -
Sample form 2
You can find the other form definition here. You will need to attach this file. -
Developer documentation
More instructions for developing and using field plug-ins can be found here: https://github.com/surveycto/Field-plug-in-resources