Question type - Short free text/en: Difference between revisions
From LimeSurvey Manual
(Importing a new version from external source) |
(从外部源导入一个新的版本) |
||
Line 58: | Line 58: | ||
{{QS:location_mapwidth}} | {{QS:location_mapwidth}} | ||
{ | {{QS:location_mapheight}} | ||
{ | {{QS:numbers_only}} | ||
{INCLUDE(page="Advanced question settings",start="!page_break",stop="---")}{INCLUDE} | {INCLUDE(page="Advanced question settings",start="!page_break",stop="---")}{INCLUDE} |
Revision as of 08:40, 13 June 2013
Short description
This question type collects a single line of text input.
Core settings
Mandatory
Description
This option allows the survey administrators to request their respondents to answer certain survey questions. If the mandatory questions are not answered, the respondents will not be able to proceed further. If you have a question with multiple subquestions, and you require only certain subquestions to be answered, use the minimum answer attribute located under the Logic tab.
Available options
- On - Question must be answered before the participant can proceed to the next page - the answer option 'No answer' is never shown.
- Soft - If the question is not answered, a warning is shown when trying to proceed to the next page - however, the participant can choose to ignore the warning and proceed. Note that the 'No answer' option is still shown (if activated in survey presentation settings)
- Off (default) - Question can be left unanswered
If the map is enabled as a google map, and the question is set to mandatory, the survey user must move the red point, or enter the Lat/Long text box. The user may not merely rely on the default, and hit the "NEXT" button. It is recommended that you so advise in the substance of the question text.
Validation (using regular expressions) (preg_validation)
Description
This option lets you specify a regular expression with which you can validate all the parts of a question.
If any question or subquestion value does not meet the validation requirements, the background colour of the text entry field will be changed to red so that users can easily see which parts of the question need to be corrected. Thus, you can do on-page validation. In this way you will not need to wait for the user to click on the submit button to validate the respective question.
Valid values
- Any valid regular expression
Example
- Click here to check multiple examples.
Condition (previously "Relevance equation")
Description
If the result value of the condition is "1" or "true", the question is "relevant" in the survey context, i.e. it is shown to the survey participant. If not, the question is hidden. Any survey question allows you to specify a relevance equation. This function is the successor of conditions and supports much more complex conditional logic.
Syntax Highlighting
Whenever you save the condition, it is evaluated and syntax-highlighted. Any errors will be color coded so that you can quickly detect and fix them.
Valid values
- Any condition that makes use of the ExpressionScript syntax, without surrounding curly braces.
Examples
Here are good examples of syntax highlighting.
Advanced settings
Prefix (prefix)
Description
A text value to be shown as prefix before the text input box(es). The prefix is shown just left of the input.
If the screen is small, then the prefix will be displayed above the input. If you want to leave it on the left (New in 3.0.0 ) : add suffix-prefix-force class to the question.
Valid values
- Any character or set of characters you wish to be displayed before the input
Example
Entering a value of "$" for this attribute would result in a dollar sign being displayed immediately preceding the text input box.
Suffix (suffix)
Description
A text value to be suffixed to a text entry box. The sufix is shown just right of the input.
On little screen : sufix is shown below the input. If you want to leave it at right (New in 3.0.0 ) : add suffix-prefix-force class to the question.
Valid values
- Any character or set of characters you wish to be displayed after the input
Example
Entering a value of "%" for this attribute would result in a percentage sign being displayed immediately after the text input box.
Display rows (display_rows)
Description
It sets the number of rows that are displayed without making use of the scroll bar to check all the content. If there are more rows than the number mentioned in this field, then a scroll bar will be displayed. The default value for the "Long free text" question type is 5, while for the "Huge free text question type" is 30.
Valid values
- Any positive integer number greater than 0
Input box width (text_input_width)
Description
This attribute sets the width of the text input boxes (of the "wrapper" of the text input boxes). The input box is used to introduce an answer to the (sub)question. If the value of the width is sufficiently high, then the text input box will be displayed on the next line. Please note that this option does not set the size of the input or the width of the entire column!
Available options
- Default: If selected, a default value will be allocated to this attribute in such a way to have both the label and its corresponding text input box on the same line. For example, if the text input box width is 41%, the value of the width of the text input box will be a value that allows both the label and the input box on the same line (58% in this case). If the width of text input box was higher than 58%, then the text input box would be displayed on the next line.
- 8%; 17%...92%, 100%: the bigger the selected value, the larger the width of the text input box.
Example
- If you wish to have the input part displayed below the subquestion/label, select the 100% option from the dropdown list.
Description
If enabled, the question will always be hidden - it will not be displayed to the survey participants. This function can be used in the following scenarios:
- If you wish to prefill a question with a URL and you want not to have it displayed on the screen. This overrides any conditions used within the survey because the respective question will not even be embedded on the page.
- If you wish to store or calculate a value on the fly via the ExpressionScript - Presentation.
Available options
- On
- Off (default)
Maximum characters (maximum_chars)
Description
This allows you to set the maximum number of characters that can be entered for a text based question. Entering a value of, say, 20 will mean that the participant cannot enter any more than 20 characters.
Valid values
- Any integer value above 0
Randomization group name (random_group)
Description
It places the questions into a specified randomization group, all questions included in the specified group being displayed in a random order to the survey respondents.
You can find a sample survey using randomization group name in ExpressionScript sample survey.
Valid values
Just enter any string you like (for example: 'group1'). All question which have set the same string within the randomization group name box will have their place in the survey randomized (=randomly exchanged among each other).
Preview
To preview the questions use the preview survey instead of the preview question group function, as the second has been reported to not show the questions in a randomized order.
Use mapping service (location_mapservice)
Description
If this option is activated, then the free text question type will display a map and not a text box to the respondents (they cannot be used both together concurrently).
Available options
- Off (default)
- OpenStreetMap via MapQuest
- Google Maps
Advanced
IP as default location (location_nodefaultfromip)
Description
If enabled, the default position on the map should be based on the user's IP address.
For this to work you have to set a valid key in IP Info DB API Key.
Available options
- Yes (default)
- No
Save country (location_country)
Description
If enabled, the country information will be stored in the survey results table. Only usuable with google map and a valid google map API key.
Available options
- Yes
- No (default)
Save city (location_city)
Description
If activated, the city information will be stored in the survey results table. Only usable with Google Maps and a valid Google Maps API key.
Available options
- Yes
- No (default)
Save state (location_state)
Description
If activated, the state information will be stored in the survey results table. Only usable with Google Maps and a valid Google Maps API key.
Available options
- No (default)
- Yes
Save postal code (location_postal)
Description
Enable this option if you wish the postal code to be stored in the survey results table. Only usuable with google map and a valid google map API key.
Available options
- Yes
- No
Default position (location_defaultcoordinates)
Description
Type in here the latitude and longitude where the map will be centered when loaded.
Example
Latitude [space] longitute: 52.1605 9.8438
Zoom level (location_mapzoom)
This options allows the survey administrator to set the zoom level for the map.
Valid values
- The minimum value that can be inserted is 0, while the maximum is 11.
Example
The below image shows a 500x300 map using zoom level = 5:
Map width (location_mapwidth)
Set in this field the width of the map in pixels. The default value is 500px.
Map height (location_mapheight)
Set in this field the height of the map in pixels. The default value is 300.
Numbers only (numbers_only)
Description
If you enable this option, the participant can only enter numbers in the text box(es).
For the equation question types, this setting indicates that the result could only be a number, not a string. This will guarantee proper calculations/conversions in follow-up equations regarding the decimal mark.
Behavior by question type
- Default: If the subject enters a value that is not a number, that value is immediately cleared from the text box so that the subject can enter an appropriate value.
- Array (Texts): If the numbers only option is disabled, the "Show totals for" and "Show grand total" options will be overruled, while the total text boxes will not be displayed.
- Equation: Enabling this option will force the equation results to be converted to a numeric value. If the equation result is not a number (and not blank), the equation will return NaN, being saved as an empty string in the response table.
Available options
- On
- Off (default)
{INCLUDE(page="Advanced question settings",start="!page_break",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_action",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_disable_next",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_disable_prev",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_countdown_message",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_timer_style",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_message_delay",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_message",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_message_style",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_warning",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_warning_display_time",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_warning_message",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!time_limit_warning_style",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!em_validation_q",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!em_validation_q_tip",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!em_validation_sq",stop="---")}{INCLUDE}
{INCLUDE(page="Advanced question settings",start="!em_validation_sq_tip",stop="---")}{INCLUDE}