Actions

Default answers/fr: Difference between revisions

From LimeSurvey Manual

(Updating to match new version of source page)
(Updating to match new version of source page)
Line 18: Line 18:


{{Alert|Title=Attention|text= '''Attention:'''
{{Alert|Title=Attention|text= '''Attention:'''
* If you have hidden question with default value, this default value is set only when the user come to the step of this question. This mean that if whole group his hidden, then no default value is set, or if you are in question by question mode, no default value is set.
* For hidden question, an alternative solution can be used Expression manager with [[Expression Manager#Caution_about_using_Assignment_Operator_.28.3D.29|assignment operator]].}}
* For hidden question, an alternative solution can be used Expression manager with [[Expression Manager#Caution_about_using_Assignment_Operator_.28.3D.29|assignment operator]].}}
=Default value with Expression Manager=
Only text and Yes/No question type allow usage of Expression Manager for default value. For all other question you can use [[Expression_Manager#Using_Assignment_Operator|Assignment Operator]]


=Example=
=Example=
*You have a non-anonymous survey, where {TOKEN:ATTRIBUTE_1} is the person's age as of the time the survey participants table was created. You want to prefill a question/default answer with the person's age and ask them to validate the age or to let him or her change the age value if it is not accurate. To do that, enter {TOKEN:ATTRIBUTE_1} in the text entry field for the default answer.
*You have a non-anonymous survey, where {TOKEN:ATTRIBUTE_1} is the person's age as of the time the survey participants table was created. You want to prefill a question/default answer with the person's age and ask them to validate the age or to let him or her change the age value if it is not accurate. To do that, enter {TOKEN:ATTRIBUTE_1} in the text entry field for the default answer.

Revision as of 12:35, 27 June 2018


Introduction

You can assign for different question types a default value to be recorded in the case in which the survey participant skips the question or decides that he or she is happy with the provided default answer. To access this option, look for the edit default answers button located on the question panel:



Valid values

  • For single choice questions, you will see drop-down boxes from where you can select the desired default value.
  • For multi choice questions, you will see checkboxes from where you can select the desired default state (checked or not-checked).
  • For text-entry questions, you will have a text entry field in which you can enter any string or expression. If you use an expression, curly brackets must be used.
  • For date-time questions, if you're using an expression to set a date, the format must be like date ('Y-m-d') or date ('Y-m-d H:s'). For example, if you want to set the current time as default in a date question with format HH:MM (hour and minute), you would have to use the full time format in the default answer box: date ('Y-m-d H:s'). The format in the expression is independent of the format in the question settings.
  Attention:
  • For hidden question, an alternative solution can be used Expression manager with assignment operator.


Default value with Expression Manager

Only text and Yes/No question type allow usage of Expression Manager for default value. For all other question you can use Assignment Operator

Example

  • You have a non-anonymous survey, where {TOKEN:ATTRIBUTE_1} is the person's age as of the time the survey participants table was created. You want to prefill a question/default answer with the person's age and ask them to validate the age or to let him or her change the age value if it is not accurate. To do that, enter {TOKEN:ATTRIBUTE_1} in the text entry field for the default answer.