Actions

QS

Array filter/sl: Difference between revisions

From LimeSurvey Manual

(Updating to match new version of source page)
(Updating to match new version of source page)
Line 6: Line 6:
'''Opis'''
'''Opis'''


Filter polja vam omogoča  izbiro  odgovorov, ki se prikažejo v naslednjem vprašanju z lestvico.
The '''Array filter''' setting allows you to use any multiple choice question to select or set which responses are displayed in a subsequent list, array or multiple choice question.


<div class="simplebox">Od verzije 1.92 dalje je  možno filtrirati odgovore za nadaljno vključevanje v vprašanja polj, vključno z:
<div class="simplebox">The subsequent questions can be filtered on any array question type, including:
*Izbira več možnosti
*Multiple choice
*Izbira več možnosti s kometarji
*Multiple choice with comments
*Več kratkih tekstovnih odgovorv
*Multiple short text
*Več številčnih odgovorov
*Multiple numeric
*Lestvice in polja (5 stopenjska, 10 stopenjska, Da/Ne/Ne vem, Povečalo/Ostalo enako/Zmanjšalo, Stolpec)
*Array (5 point, 10 point, Yes/No/Unknown, Increase/Same/Decrease, Column)
*Lestvica (Dvostopenjska lestvica, besedilo, števila)
*Array (Dual Scale, Text, Numbers)
*Razvrstitev
*Ranking


Furthermore, each of these types of questions can be filtered.
Furthermore, each of these types of questions can be filtered.


Edina izjema je tip vprašanja Polje (stolpci), ki se lahko uporabi za filtriranje drugih vprašanj, medtem ko ta vrsta vprašanja ne more biti filtrirana.</div>
The only exception is ''Array (Column)'', which can filter other questions, but not itself.</div>


'''Nastavitev filtra'''
'''How to set a filter'''


Za nastavitev filtra vnesite kodo vprašanja z več možnostmi. Na primer, če je koda vprašanja "Q1" vnesite "Q1" v vnosno polje "Filter polja" ali v vnosno polje "Izločitev filtra polja", ki se nahajajo znotraj naprednih nastavitev vprašanja, ki ga želite filtrirati. Vidni bodo samo odgovori, ki so bili izbrani znotraj vprašanja Q1.
To set a filter, enter the question code of a multiple options question in the array filter box of the question you are currently editing. The respective question will be used as the source of information for the current question, the selected answers from the previous question being retrieved and used as answer options for the current question. '''For example''', if your source multiple option question code is "Q1", enter "Q1" into the 'Array Filter' box to start the filtering process of the answers. Only the answer options that are selected in question Q1 will be visible in the array_filter-ed question.


<div class="simplebox">Od verzije 1.92 naprej lahko vnesete več možnosti v filter za posamezno vpršanje s pomočjo ločevanja s podpičji.</div>
<div class="simplebox">If you wish more questions to be filtered via this option, type the question codes in the box separated by semicolons (;). </div>


Array filter question settings ''require'' the questions being used to have exactly matching lists of answers. If the questions do not have exactly the same set of answers and codes, then the filters will break.
{{Alert|Title=Attention|text=The subquestion codes used in the first question must coincide with the subquestion codes from the second one. Otherwise, the '''array filter''' function will not filter the answers to the first question. Check the below example to better understand how the whole system works.}}
 
<div class="simplebox">Starting in 1.92, if Q2 has sub-questions that are not present in Q1, they will always be displayed rather than breaking the filters.</div>


'''Cascading'''
'''Cascading'''


The Array filter will cascade &ndash; that is you can select a question which filters another question, which filters another question, and so on.
The selected options can be displayed in cascade. This means that you can select a question which filters another question, which filters another question, and so on.


'''Array filter example'''
'''Array filter example'''


Ticking items &lsquo;One&rsquo;, &lsquo;Three&rsquo; and &lsquo;Four&rsquo; in the first question results in the entries 'One', 'Three' and 'Four' displaying in the subsequent question which uses array filter
Let's take a look at the following example to better understand the power of this setting:
 
Multi option question
 
Code:Q1
 
Question: Which animals do you like?
 
1 Cat
 
2 Dog
 
3 Zebra
 
Array 5 Point Choice Question
 
Code:Q2
 
Question: Rate these animals on a scale of 1 to 5, where 1 is ''I like them a little'' and 5 is ''I like them a lot''
 
'''Array filter example 2 - Using Multiple Short Text'''
 
<div class="simplebox">Note: This features is available starting in version 1.92</div>
 
[[File:array_filter_with_multipe_short_text.jpg]]
 
Here is the Limesurvey Group file for the above demo


[[Media:limesurvey_group_32.lsg|limesurvey_group_32.lsg]]


'''Array filter example 3 - Cascading Array Filters'''
<center>[[File:array_filter_with_multipe_short_text.jpg]]</center>


This sample survey shows use of array_filter, array_filter_exclude, and exclude_all_others, plus cascading array filters.


[[Media:ls2_cascading_array_filter.lss|ls2_cascading_array_filter.lss]]
In the screenshot from above, we got two questions. The first one is a ''multiple short text'' question type, while the second one is an ''array dual scale'' question type. The answers you provide in the first question will be listed in the second one. Technically, the answers you provide to the subquestions from the first question are filtered and displayed in the second question.


This example can be downloaded from the following link: [[Media:limesurvey_group_32.lsg|limesurvey_group_32.lsg]]. [[Question_groups_-_introduction#Import_a_question_group|Import this question group]] into your LimeSurvey installation.
</onlyinclude>
</onlyinclude>


[[Category:Question Settings/sl]][[Category:Advanced Question Settings/sl]]
[[Category:Question Settings]][[Category:Question Logic Settings]]

Revision as of 21:50, 7 March 2018


Filter polja (array_filter)

Opis

The Array filter setting allows you to use any multiple choice question to select or set which responses are displayed in a subsequent list, array or multiple choice question.

The subsequent questions can be filtered on any array question type, including:
  • Multiple choice
  • Multiple choice with comments
  • Multiple short text
  • Multiple numeric
  • Array (5 point, 10 point, Yes/No/Unknown, Increase/Same/Decrease, Column)
  • Array (Dual Scale, Text, Numbers)
  • Ranking

Furthermore, each of these types of questions can be filtered.

The only exception is Array (Column), which can filter other questions, but not itself.

How to set a filter

To set a filter, enter the question code of a multiple options question in the array filter box of the question you are currently editing. The respective question will be used as the source of information for the current question, the selected answers from the previous question being retrieved and used as answer options for the current question. For example, if your source multiple option question code is "Q1", enter "Q1" into the 'Array Filter' box to start the filtering process of the answers. Only the answer options that are selected in question Q1 will be visible in the array_filter-ed question.

If you wish more questions to be filtered via this option, type the question codes in the box separated by semicolons (;).
  The subquestion codes used in the first question must coincide with the subquestion codes from the second one. Otherwise, the array filter function will not filter the answers to the first question. Check the below example to better understand how the whole system works.


Cascading

The selected options can be displayed in cascade. This means that you can select a question which filters another question, which filters another question, and so on.

Array filter example

Let's take a look at the following example to better understand the power of this setting:



In the screenshot from above, we got two questions. The first one is a multiple short text question type, while the second one is an array dual scale question type. The answers you provide in the first question will be listed in the second one. Technically, the answers you provide to the subquestions from the first question are filtered and displayed in the second question.

This example can be downloaded from the following link: limesurvey_group_32.lsg. Import this question group into your LimeSurvey installation.