Actions

Question type - Date/sl: Difference between revisions

From LimeSurvey Manual

No edit summary
(Updating to match new version of source page)
(29 intermediate revisions by 3 users not shown)
Line 5: Line 5:
=Kratek opis=
=Kratek opis=


<onlyinclude>{{#ifeq:{{{transcludesection|short_description}}}|short_description|Ta tip vprašanja lahko uporabimo, če želimo povprašati po določenem datumu, ki ga lahko direktno vnesemo s pomočjo JavaScript koledarja ali z uporabo spustnega menija. Od verzije 1.80 dalje je možno določiti minimalno in maksimalno vrednost, ki je navedena v spustnem meniju.
<div style="display:none;"></div>
<onlyinclude>{{#ifeq:{{{transcludesection|short_description}}}|short_description|<div style="display:none;"></div>


This question type can be used to ask for a certain date, time or a combination of both date and time. The values can be selected by the participants either from a popup calendar or from [[Question type - Date#Display dropdown boxes (dropdown_dates)|dropdown boxes]]. [[Question type - Date#Question validation equation (em_validation_q)|Validation]], [[Question type - Date #Minimum date (date_min)|minimum]], and/or [[Question type - Date#Maximum date (date_max)|maximum dates]] can be chosen by the survey administrator. Various date and time formats [[Question_type_-_Date#Date/Time format|are supported]].
<div class="mw-translate-fuzzy">
[[File:D_Date_DD.jpg]]
[[File:D_Date_DD.jpg]]
</div>
'''Example:''' [[Media:Example_Date_Time.zip|Example_Date_Time.zip]]
<div style="display:none;"></div>}}</onlyinclude><div style="display:none;"></div>


}}</onlyinclude>
<div class="mw-translate-fuzzy">
=Glavne nastavitve=
=Glavne nastavitve=
</div>


{{QS:mandatory/sl}}
{{QS:mandatory/sl}}
{{QS:defaults/sl}}


{{QS:relevance/sl}}
{{QS:relevance/sl}}


<div class="mw-translate-fuzzy">
=Napredne nastavitve=
=Napredne nastavitve=
</div>
{{QS:dropdown_dates/sl}}
{{QS:hide_tip}}
{{QS:Month_display_style}}
{{QS:Reverse/sl}}
{{QS:Question_theme}}
{{QS:Hidden/sl}}
{{QS:CSS_Class}}
<div class="mw-translate-fuzzy">
{{QS:em_validation_q/sl}}
</div>
<div class="mw-translate-fuzzy">
Ta tip vprašanja lahko uporabimo, če želimo povprašati po določenem datumu, ki ga lahko direktno vnesemo s pomočjo JavaScript koledarja ali z uporabo spustnega menija. Od verzije 1.80 dalje je možno določiti minimalno in največjo vrednost, ki naj še bo prikazana v spustnem seznamu.
</div>


{{QS:Reverse}}
{{QS:Printable_survey_relevance_help}}


{{QS:Random_group}}
=Input=


{{QS:dropdown_dates}}
{{QS:date_time_format}}


{{QS:Hidden}}
{{QS:Minute_step_interval}}


{{QS:dropdown_dates_year_min}}
=Logic=


{{QS:dropdown_dates_year_max}}
{{QS:Random_group/sl}}


{{QS:em_validation_q}}
{{QS:em_validation_q}}


===Validation on date===
<div class="mw-translate-fuzzy">
{{Alert||text=Dates in Limesurvey are saved as a string (text format).}}
{{QS:Page_break/sl}}
<div class="boxed">To really be able to work (and calculate) with dates, these have to be converted to a number format. The function strtotime{{NewIn|2.0|b=130515}} , which calculates the number of seconds from the 1st January 1970 to a given date can be used for this. Using strtotime() one can for example enforce that only dates before "today" are entered using the following expression: strtotime(self)<=strtotime("now").
</div>
Or enforce that that only dates after a certain date can be entered: strtotime(self)>strtotime("2013-03-27")</div>
 
=Other=
 
{{QS:Page_break}}
 
=Statistics=


{{Alert|Please be aware that strtotime() works with a lot of different but not ALL date formats. Limesurvey's default date format (MM-DD-YYYY) does NOT work with strtotime(). Please set your survey to use one of the following date formats to avoid problems: YYYY-MM-DD, YYYY/MM/DD, DD.MM.YYYY, MM/DD/YYYY, DD-MM-YYYY.}}
{{QS:Display_chart}}


{{QS:Chart_type}}


{{QS:em_validation_q_tip}}


{{QS:Page_break}}
<div class="mw-translate-fuzzy">
{{Alert|Upoštevajte, da ukaz strtotime() deluje z veliko različnimi vendar ne z vsemi oblikami datumov. Ravno LimeSurvey-eva privzeta oblika datuma (MM-DD-YYYY) ne podpira strtotime(). Priporočamo, da nastavite vašo anketo na eno izmed naslednjih oblik datuma in se s tem izognete omenjenemu problemu: YYYY-MM-DD, YYYY/MM/DD, DD.MM.YYYY,  MM/DD/YYYY, DD-MM-YYYY.}}
</div>
 
Limesurvey (versions 2.05+ and above) makes it fairly easy to validate dates using the [[Question type - Date#Minimum date (date_min)|date_min]] and [[Question type - Date#Maximum date (date_max)|date_max]] fields (see above). Use these whenever possible. If you need to do more advanced validation, you may be able to work (and calculate) with dates using the [[ExpressionScript - Presentation|ExpressionScript]] and the function strtotime(). It calculates the number of seconds from the 1st January 1970 to a given date.
 
 
'''Example:''' if you want to display in a question text the number of days that have passed since a departure date (asked in a previous question) and today, you can can use the expression {(strtotime("now")-strtotime(departure))/60/60/24}.
 
 
Please be aware that strtotime() works with a lot of different formats, but with not all of them! For example, Limesurvey's default date format (MM-DD-YYYY) does '''NOT''' work with strtotime(). Please set your survey to use one of the following date formats to avoid problems: YYYY-MM-DD, YYYY/MM/DD, DD.MM.YYYY, MM/DD/YYYY or DD-MM-YYYY.
 
{{Alert||text=Dates in Limesurvey are saved as a string (text format). The [[ExpressionScript - Presentation|ExpressionScript]] converts all dates part of an expression into the standard format "yyyy-mm-dd HH:MM:SS". This makes it much easier to compare dates in an expression (e.g. "date1>date2"). If you need a datestring in the format it was asked in the question, use the ".shown" attribute (e.g.: You were born on the {birthdate.shown}.)}}
 
 
[[Category:Question types]][[Category:Mask questions]]

Revision as of 16:45, 20 May 2020

Kratek opis

This question type can be used to ask for a certain date, time or a combination of both date and time. The values can be selected by the participants either from a popup calendar or from dropdown boxes. Validation, minimum, and/or maximum dates can be chosen by the survey administrator. Various date and time formats are supported.

Example: Example_Date_Time.zip

Glavne nastavitve


Obvezno

Opis

Ta možnost skrbnikom ankete omogoča, da od svojih anketirancev zahtevajo, da odgovorijo na določena anketna vprašanja. Če na obvezna vprašanja ne odgovorijo, anketiranci ne bodo mogli nadaljevati. Če imate vprašanje z več podvprašanji in zahtevate odgovor le na določena podvprašanja, uporabite atribut minimalni odgovor, ki se nahaja pod zavihkom Logika.

Template:Opomba


Razpoložljive možnosti

  • Vklopljeno - na vprašanje je treba odgovoriti, preden lahko udeleženec nadaljuje na naslednjo stran - možnost odgovora 'Brez odgovora' ni nikoli prikazana.
  • Soft - Če na vprašanje ni odgovorjeno, se ob poskusu nadaljevanja prikaže opozorilo naslednja stran - vendar se lahko udeleženec odloči, da opozorilo prezre in nadaljuje. Upoštevajte, da je možnost 'Brez odgovora' še vedno prikazana (če je aktivirana v nastavitvah predstavitve ankete)
  • Izklopljeno (privzeto) - Vprašanje lahko ostane brez odgovora


Pogoj (prej "Enačba ustreznosti")

Opis

Če je rezultat pogoja »1« ali »true«, je vprašanje v kontekstu ankete »relevantno«, torej se prikaže anketirancu. Če ne, je vprašanje skrito. Vsako anketno vprašanje vam omogoča, da določite enačbo pomembnosti. Ta funkcija je naslednica pogojev in podpira veliko bolj zapleteno pogojno logiko.

Označevanje sintakse

Kadarkoli shranite pogoj, je ovrednoten in sintaktično poudarjen. Morebitne napake bodo označene z barvami, da jih boste lahko hitro odkrili in odpravili.

 Hint: Če želite preveriti, ali so vsi pogoji v vaši anketi pravilno uporabljeni, preberite o naši funkciji prikaži logično datoteko.


Veljavne vrednosti

  • Kateri koli pogoj, ki uporablja sintakso ExpressionScript brez okoliških zavitih oklepajev.

Primeri

Tu so dobri primeri označevanja sintakse.


Napredne nastavitve


Prikaži spustne sezname (dropdown_dates)

Opis

Če je omogočeno, bo vrsta vprašanja o datumu/času anketirancem prikazala spustno polje, kjer lahko izberejo datum/čas, namesto privzetega pojavnega okna.

Veljavne vrednosti

  • Da
  • Ne (privzeto)

Primer

Če je vklopljen, bo vprašanje prikazano na naslednji način:



Hide tip (hide_tip)

Description

Most questions will usually include a tip that says "Please choose one of the following options" or a hint text on how to fill out the question. This attribute allows you to turn off or on this tips/hints.

These tips/hints include validation criteria messages (such as min/max number of answers, min/max/equals sum value). If hide_tip is enabled, these messages will be hidden. However, if the user enters invalid data, the tips will appear. They will be coloured in red, getting changed to green once the validation criteria are met.

Available options

  • On - the tips/hints are hidden;
  • Off (default).


Month display style (month_display_style)

Description

The months can be displayed to the respondents in three ways: by using their short names (Jan, Feb, etc.), full names (January, February, etc.) or the number/position of the month in the yearly calendar (01 for January, 02 for February, and so on).

Available options

  • Short names
  • Full names
  • Numbers



Nasprotni vrstni red odgovorov (reverse)

Opis

Če je aktivirana, bo vrstni red odgovorov obrnjen.

Veljavne vrednosti

  • Da
  • Ne (privzeto)

Primer

Predpostavimo, da želite uporabiti vrsto vprašanja Matrika (števila). Če je ta možnost onemogočena (privzeta vrednost), so možni odgovori, ki jih lahko izbere udeleženec ankete: "1, 2, 3, ... , 10". Če je omogočena, bo nastavitev obrnila vrstni red razpoložljivih odgovorov: "10, 9, 8, ... , 1".


Question theme (question_theme)

Description

It allows you to use customized themes for the respective question.

Available options

  • Your created question themes which are located under the Question themes in the Themes panel.

See: https://manual.limesurvey.org/Question_themes

Note: This feature is under development at the moment.


Vedno skrij to vprašanje (skrito)

Opis

Če je omogočeno, bo vprašanje vedno skrito – ne bo prikazano udeležencem ankete. To funkcijo je mogoče uporabiti v naslednjih scenarijih:

  • Če želite vprašanje vnaprej izpolniti z URL-jem in ne želite, da se prikaže na zaslonu. To preglasi vse pogoje, uporabljene v anketi, ker zadevno vprašanje sploh ne bo vdelano na stran.
  • Če želite sproti shraniti ali izračunati vrednost prek ExpressionScript - Presentation.
Opomba: Pogosta vrsta vprašanja, ki se uporablja s to funkcijo, je Equation.

'Razpoložljive možnosti

  • Vklopljeno
  • Izklopljeno (privzeto)


CSS class (css_class)

Description

If you want to add special CSS classes to certain questions, you can enter the CSS class name(s) in this box. Make sure you leave an empty space between different class names.

Valid values

  • Any text string with a space between different CSS class names.
 Hint: You can also insert an expression in this box (New in 3.0.0 ). Remember that the output of the expression will not be updated dynamically.


  According to the W3C, CSS class names can contain only the characters [a-zA-Z, and 0-9] and ISO 10646 characters U+00A1 and higher, plus the hyphen (-) and the underscore (_). They cannot start with a digit, or a hyphen followed by a digit. LimeSurvey encodes CSS classes, but it does not fix it totally.




Enačba za preverjanje veljavnosti vprašanja (em_validation_q)

Opis

To je enačba, ki se uporablja za potrditev celotnega vprašanja (npr. vseh njegovih delov skupaj za vprašanje z več odgovori). Če vprašanje ne izpolnjuje meril za preverjanje veljavnosti, bo prikazano sporočilo em_validation_q_tip (uporablja slog CSS .error). Ta nasvet uporablja slog CSS .em_q_fn_validation, ki je privzeto skrit v template.css.

Glavna razlika med to funkcijo in enačbami potrjevanja podvprašanja (em_validation_sq možnost) je v tem, da se za to funkcijo lahko prikaže sporočilo o napaki, če vprašanje (ali deli vprašanja) ne uspejo prestati preverjanja. Za preverjanje veljavnosti podvprašanja bo vsaka celica za vnos besedila (npr. v matrični vrsti vprašanja, lahko pa se uporabi tudi za vrste vprašanj z enim vnosom) oblikovana tako, da bo barva ozadja (svetlo) rdeča.

Veljavne vrednosti

  • Katera koli enačba, ki uporablja sintakso ExpressionScript brez okoliških zavitih oklepajev.

Primer

  • Od uporabnikov želite zbrati demografske podatke z več kratkimi besedilnimi vprašanji in želite potrditi, da je uporabnik vnesel veljaven e-poštni naslov in telefonsko številko.

Ta primer prikazuje, kako izgleda vprašanje z neveljavnimi odgovori:

Datoteka:validation-invalid-both.jpg

In tako izgleda z enim neveljavnim odgovorom:

Datoteka:validation-invalid-phone.jpg

Tukaj je, kako uredite vprašanje, da vnesete te podatke:

Datoteka:validation-gui.jpg

Tukaj je del Pokaži logično datoteko, ki vam omogoča, da preverite točnost svojega izraza in zagotovite, da ni sintaksičnih napak:

Datoteka:validation-logic.jpg

Kot lahko vidite, enačba preverjanja preverja, ali sta e-poštni naslov in telefonska številka prazna ali se ujemata s filtrom regularnega izraza.

Namig za preverjanje prikaže opozorilno sporočilo samo, če se telefon ali e-pošta zdita neveljavna.

 Hint: Če želite ustvariti zapletena potrditvena sporočila, preberite o uporabi ExpressionScript.


Če želite uvoziti zgornji primer v svojo namestitev LimeSurvey, prenesite to datoteko .lsq: Em_validation_q_example.zip.

 Hint: Ne pozabite, LimeSuvey uporablja sintakso Perl za regularne izraze, zato se morajo začeti in končati z / (poševnica)!


Ta tip vprašanja lahko uporabimo, če želimo povprašati po določenem datumu, ki ga lahko direktno vnesemo s pomočjo JavaScript koledarja ali z uporabo spustnega menija. Od verzije 1.80 dalje je možno določiti minimalno in največjo vrednost, ki naj še bo prikazana v spustnem seznamu.


Relevance help for printable survey (printable_survey_relevance_help)

Description

If you wish to print a survey, you can also print the relevance equations for each question. But, if you wish to offer instead an explanation rather than the expression on the printed form, fill in this box with the text explanation for the relevance equation.

Valid values

  • Any text and/or numbers you wish to be displayed on the printable form.


Input

Date/Time format

Description

This question option can be used to specify a custom date format. If it is empty, the survey date format will be used.

Valid values

  • The d/dd,m/mm,yy/yyyy,H/HH,M/MM formats can be used to display the date and/or time, while "-", ".", "/", ":" can be used as separators.

Examples

  • yyyy-mm-dd - year-month-day;
  • dd.mm.yyyy HH:MM - day.month.year Hour:Minute;
  • HH:MM - Hour:Minute (only the time can be selected);
  • yyyy/mm - year/month.



Minute step interval (minute_step_interval)

Description

 Hint: This feature changed with version 3.14.12


It's used only input format makes use of minutes ("MM") .


Valid values

  • Any numerical value smaller than 60. Adding a value bigger than 60 is redundant -> only "0" or "00" will be displayed in the dropdown box as possible answers.


Example

In the below example, the minute step interval option was set up to 7:


Logic

Ime naključne skupine (random_group)

Opis

Vprašanja postavi v določeno naključno skupino, pri čemer so vsa vprašanja, vključena v navedeno skupino, prikazana v naključnem vrstnem redu anketirancem.

V ExpressionScript sample survey lahko najdete vzorec ankete z imenom skupine za naključno izbiranje.

Veljavne vrednosti

Samo vnesite poljuben niz (na primer: 'group1'). Vsa vprašanja, ki so v polju 'ime skupine za naključno izbiro nastavili isti niz, bodo imela svoje mesto v anketi randomizirana (=naključno izmenjana med seboj).


Predogled Za predogled vprašanj uporabite predogled ankete namesto funkcije predogled skupine vprašanj, saj so poročali, da druga ne prikazuje vprašanj v naključnem vrstnem redu.



Question validation equation (em_validation_q)

Description

This is an equation that is used to validate the entire question (e.g, all of its parts collectively for a multi-answer question). If the question fails the validation criteria, then em_validation_q_tip message will be displayed (it uses the CSS style .error). This tip uses the .em_q_fn_validation CSS style, which is hidden by default within template.css.

The main difference between this feature and the subquestion validation equations (em_validation_sq option) is that for this feature, if the question (or question parts) fail validation, then an error message could be shown. For the subquestion validation, each text entry cell (e.g., in an array question type, but it can also be applied to single entry question types) will be styled so that the background color is (light) red.

Valid values

  • Any equation that makes use of the ExpressionScript syntax, without surrounding curly braces.

Example

  • You want to collect demographic information from users via a multiple short text question, and you want to validate that the user has entered a valid email address and phone number.

This example shows how the question looks with invalid answers:

And here is what it looks like with one invalid answer:

Here is how you edit a question to enter that information:

And here is part of the Show Logic File output that lets you check the accuracy of your expression and ensure that there are no syntax errors:

As you can see, the validation equation tests that both the email and phone number are either empty or match a regular expression filter.

The validation tip only shows the warning message if the phone or email appears invalid.

 Hint: In order to create complex validation messages, read about the usage of the ExpressionScript.


If you wish to import the example from above into your LimeSurvey installation, download the following .lsq file: Em_validation_q_example.zip.

 Hint: Remember, LimeSuvey uses the Perl syntax for regular expressions, so they should start and end with / (slash character)!


Vstavi prelom strani v pogledu za tiskanje (page_break)

Opis

Ta atribut je aktiven le, ko dejansko natisnete anketo iz »Pogleda za tiskanje«. Vsili prelom strani pred vprašanjem.

Razpoložljive možnosti

  • Vklopljeno
  • Izklopljeno (privzeto)

Other

Insert page break in printable view (page_break)

Description

This attribute is only active when you actually print a survey from the Printable View. It forces a page break before the question.

Available options

  • On
  • Off (default)


Statistics

Display chart (display_chart)

Description

This attribute allows the survey administrator to choose if a chart that contains the question results should be displayed to the survey participants after they filled out the survey.

Note: To have the chart displayed on the last page, you have to enable the following options:


Available options

  • On
  • Off (default)



Chart type (chart_type)

Description

This attribute allows the survey administrator to choose which type of chart will be displayed to the respondent once he/she finished filling out the survey.

Note: Do not forget to change the question and survey settings in order to have the charts displayed at the end on the survey. For more details, check the wiki section on the display chart question attribute.

Available options

  • Bar chart
  • Pie chart
  • Radar
  • Line
  • PolarArea
  • Doughnut


  Upoštevajte, da ukaz strtotime() deluje z veliko različnimi vendar ne z vsemi oblikami datumov. Ravno LimeSurvey-eva privzeta oblika datuma (MM-DD-YYYY) ne podpira strtotime(). Priporočamo, da nastavite vašo anketo na eno izmed naslednjih oblik datuma in se s tem izognete omenjenemu problemu: YYYY-MM-DD, YYYY/MM/DD, DD.MM.YYYY, MM/DD/YYYY, DD-MM-YYYY.


Limesurvey (versions 2.05+ and above) makes it fairly easy to validate dates using the date_min and date_max fields (see above). Use these whenever possible. If you need to do more advanced validation, you may be able to work (and calculate) with dates using the ExpressionScript and the function strtotime(). It calculates the number of seconds from the 1st January 1970 to a given date.


Example: if you want to display in a question text the number of days that have passed since a departure date (asked in a previous question) and today, you can can use the expression {(strtotime("now")-strtotime(departure))/60/60/24}.


Please be aware that strtotime() works with a lot of different formats, but with not all of them! For example, Limesurvey's default date format (MM-DD-YYYY) does NOT work with strtotime(). Please set your survey to use one of the following date formats to avoid problems: YYYY-MM-DD, YYYY/MM/DD, DD.MM.YYYY, MM/DD/YYYY or DD-MM-YYYY.

  Dates in Limesurvey are saved as a string (text format). The ExpressionScript converts all dates part of an expression into the standard format "yyyy-mm-dd HH:MM:SS". This makes it much easier to compare dates in an expression (e.g. "date1>date2"). If you need a datestring in the format it was asked in the question, use the ".shown" attribute (e.g.: You were born on the {birthdate.shown}.)