Question type - Date/sl: Difference between revisions
From LimeSurvey Manual
m (Text replacement - "Expression Manager" to "ExpressionScript") |
(Updating to match new version of source page) |
||
Line 10: | Line 10: | ||
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]]. | 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]] | |||
</ | </div> | ||
'''Example:''' [[Media:Example_Date_Time.zip|Example_Date_Time.zip]] | '''Example:''' [[Media:Example_Date_Time.zip|Example_Date_Time.zip]] | ||
Line 18: | Line 18: | ||
<div style="display:none;"></div>}}</onlyinclude><div style="display:none;"></div> | <div style="display:none;"></div>}}</onlyinclude><div style="display:none;"></div> | ||
= | <div class="mw-translate-fuzzy"> | ||
=Glavne nastavitve= | |||
</div> | |||
{{QS:mandatory/sl}} | {{QS:mandatory/sl}} | ||
Line 24: | Line 26: | ||
{{QS:relevance/sl}} | {{QS:relevance/sl}} | ||
= | <div class="mw-translate-fuzzy"> | ||
=Napredne nastavitve= | |||
</div> | |||
{{QS:dropdown_dates/sl}} | {{QS:dropdown_dates/sl}} | ||
Line 40: | Line 44: | ||
{{QS:CSS_Class}} | {{QS:CSS_Class}} | ||
{{QS: | <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:Printable_survey_relevance_help}} | {{QS:Printable_survey_relevance_help}} | ||
Line 58: | Line 66: | ||
{{QS:em_validation_q}} | {{QS:em_validation_q}} | ||
{{QS: | <div class="mw-translate-fuzzy"> | ||
{{QS:Page_break/sl}} | |||
</div> | |||
=Other= | =Other= | ||
Line 71: | Line 81: | ||
= | <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|ExpressionScript]] and the function strtotime(). It calculates the number of seconds from the 1st January 1970 to a given date. | 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. | ||
Revision as of 16:55, 19 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.
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.
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
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.
'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.
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:
In tako izgleda z enim neveljavnim odgovorom:
Tukaj je, kako uredite vprašanje, da vnesete te podatke:
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:
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.
Če želite uvoziti zgornji primer v svojo namestitev LimeSurvey, prenesite to datoteko .lsq: Em_validation_q_example.zip.
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
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.
If you wish to import the example from above into your LimeSurvey installation, download the following .lsq file: Em_validation_q_example.zip.
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.
- public statistics survey setting from the presentation & navigation settings
- show graphs survey setting from the presentation & navigation settings
- public statistics question attribute, and
- display chart question attribute.
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.
Available options
- Bar chart
- Pie chart
- Radar
- Line
- PolarArea
- Doughnut
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.