array filter for array values

Mehr
3 Jahre 5 Monate her #120239 von joost1982
joost1982 erstellte das Thema array filter for array values
Hi there, it is possible to use an array type question as an array filter. But is it also possible to show only certain values from the array question in the question in which the array filter is used?

Example:

question X - rate these things from 1 to 5

blablabla1 1 2 3 4 5
blablabla2 1 2 3 4 5
blablabla3 1 2 3 4 5
blablabla4 1 2 3 4 5
blablabla5 1 2 3 4 5

then question Y - which from the things is blablablablablabla?
Question Y must be an multiple choice question where only the things from question X are shown that are rated 4 or 5.

Is this possible?

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Jahre 5 Monate her #120243 von DenisChenu
DenisChenu antwortete auf das Thema: array filter for array values

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Jahre 5 Monate her - 3 Jahre 5 Monate her #120435 von dobelin
dobelin antwortete auf das Thema: array filter for array values
The survey showed in this link is exactly what I need, but I'm new using Limesurvey and don't now how to do this. I have already the two arrays and the filter is working (only shows the items i mark in the first array), but how can the second array show only questions marked "Sans rèponse" ?

One another thing is that I'm using online Surveylime and haven't access to the server in order to change configuration to run Javascript.
Letzte Änderung: 3 Jahre 5 Monate her von dobelin.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Jahre 5 Monate her - 3 Jahre 5 Monate her #120440 von DenisChenu
DenisChenu antwortete auf das Thema: array filter for array values
Hi

demonstration.sondages.pro/upload/survey...y_filtrecomplexe.lss

You can look at Survey Logic file

And in LimeSurvey Professional (previously LimeService) : you can use javascript in your question text. Look at the workaround fr a howto

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Letzte Änderung: 3 Jahre 5 Monate her von DenisChenu.
Folgende Benutzer bedankten sich: dobelin

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Jahre 5 Monate her - 3 Jahre 5 Monate her #120451 von dobelin
dobelin antwortete auf das Thema: array filter for array values
Hi Denis,

Thank you for your answer. My problem now is that I can't run Javascript.
Every website that I found say that I need go to set “Global settings -> Security -> Filter HTML for XSS” to “No”, but I don't have the privilegies to do this.
I tried what is in this page: manual.limesurvey.org/Workarounds:_Manip....29_in_LimeSurvey.3F but the test alert didn't work.

There is any solution?
Letzte Änderung: 3 Jahre 5 Monate her von dobelin.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Jahre 5 Monate her #120460 von DenisChenu
DenisChenu antwortete auf das Thema: array filter for array values
If you can add javascript in your question text : you need to use 2 different page.

Each question must be in sperate page, see the second system:
- first page : filter + Equation questioin type to SET the filter value (this 2 question can be in the same group than the first question and can be hidden)
- seocnd page : the array filtered.

See the second solution in lss file provided.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Folgende Benutzer bedankten sich: dobelin

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Jahre 5 Monate her #120490 von dobelin
dobelin antwortete auf das Thema: array filter for array values
Maintenant je comprends. Il a parfaitement fonctionné. Merci beaucoup pour votre patience e disposition!

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 5 Monate her - 2 Jahre 5 Monate her #135019 von keunes
keunes antwortete auf das Thema: array filter for array values
Dear all,

I have the same question, but as I don't speak French (well enough) I don't understand the explanation provided in the example (demonstration.sondages.pro/676785).

Somewhat like the OP, I have
- two (not one) array questions on page 1 (same answer categories, sub-question code continues counting)
- a multiple choice question on page 6 (same sub-question codes & names as the two array questions)
- filtering of the multiple choice question works properly based on the array questions (only shows subquestions which have been answered)

But how can the MC question be filtered on sub-questions marked "Sans réponse" (or 'never used' in my case)?
Trying to read French, I think I need to add javascript to my MC question to filter? Or should I add to my two array questions?
Letzte Änderung: 2 Jahre 5 Monate her von keunes. Begründung: clarify

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 5 Monate her - 2 Jahre 5 Monate her #135035 von mguerrero
mguerrero antwortete auf das Thema: array filter for array values
Hello,
You can use javascript and store variables in an array, and to assemble the values you can use expressions, you can also upload your .lss file to better understand the problem.
 
<script>
 
$(document).ready(function() {
 
	var sid = '{SID+'X'+GID+'X'+QID}';
 
	var arreglo = new Array();
 
	//conditions array using  expresion 
	arreglo[0] = {if((PA_1_P1.NAOK == 1)   or (PA_1_P2.NAOK == 1),0,1)};
	arreglo[1] = {if((PA_2_P1.NAOK == 1)   or (PA_2_P2.NAOK == 1),0,2)};
	arreglo[2] = {if((PA_3_P1.NAOK == 1)   or (PA_3_P2.NAOK == 1),0,3)};
	arreglo[3] = {if((PA_4_P1.NAOK == 1)   or (PA_4_P2.NAOK == 1),0,4)};
	arreglo[4] = {if((PA_5_P1.NAOK == 1)   or (PA_5_P2.NAOK == 1),0,5)};
	arreglo[5] = {if((PA_6_P1.NAOK == 1)   or (PA_6_P2.NAOK == 1),0,6)};
	arreglo[6] = {if((PA_7_P1.NAOK == 1)   or (PA_7_P2.NAOK == 1),0,7)};
	arreglo[7] = {if((PA_8_P1.NAOK == 1)   or (PA_8_P2.NAOK == 1),0,8)};
	arreglo[8] = {if((PA_9_P1.NAOK == 1)   or (PA_9_P2.NAOK == 1),0,9)};
	arreglo[9] = {if((PA_10_P1.NAOK == 1)  or (PA_10_P2.NAOK == 1),0,10)};
 
	$(arreglo).each(function(index, el) {
 
		if(el == 0)
		{
			el = "";
		}
		else{
			el = el;
			$("#javatbd"+sid+el).hide();
			$("input[name="+sid+el+"]").val('9999');
			$("input[name="+sid+el+"]").attr('checked',true);
		}
	});
 
});
 
 
</script>
Regards.
Letzte Änderung: 2 Jahre 5 Monate her von mguerrero.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 5 Monate her #135060 von tpartner
tpartner antwortete auf das Thema: array filter for array values
In the latest stable versions of LimeSurvey you can set Expression Manager relevance for individual subquestions.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 5 Monate her - 2 Jahre 5 Monate her #135065 von keunes
keunes antwortete auf das Thema: array filter for array values
Thanks @mguerrero
Wasn't sure where the scripts should be placed, but now I know the Expression Manager is possible I'd rather use that :)

@tpartner, that's what I suspected and so I tried:

- SITU1PLATWHAT_1 (sub question of the multiple choice) with Relevance Equation: if(MEDGEBRTRAD_1 != "Nooit") or if(MEDGEBRTRAD_1 != 1)
- where MEDGEBRTRAD_1 is a subquestion of an array question where Nooit is the answer text and 1 the answer code

I guess I'm doing something wrong here, but don't know what :P My coding (& Expression Manager) skills are rather limited.

Attached you find my survey, but don't know how useful it is since all the questions are in Dutch and there's quite a few questions.
Anhang:
Letzte Änderung: 2 Jahre 5 Monate her von keunes. Begründung: clarify

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 5 Monate her - 2 Jahre 5 Monate her #135073 von keunes
keunes antwortete auf das Thema: array filter for array values
ok, so that use of 'if' is wrong, I just figured out. Should be if(test,result_if_true,result_if_false), so in my case if(MEDGEBRTRAD_1="Nooit","1","0")

I guess the same can be done via regexMatch(pattern,input)?
Letzte Änderung: 2 Jahre 5 Monate her von keunes. Begründung: forgot [/tt]

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 5 Monate her #135074 von tpartner
tpartner antwortete auf das Thema: array filter for array values
Sorry, don't have time to go through a survey but it seems to me that it should be something like this (without the IF statements). Note that we are comparing to the answer CODE in row one of "MEDGEBRTRAD", not the answer LABEL.

MEDGEBRTRAD_1 != 1

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Folgende Benutzer bedankten sich: keunes

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Jahre 5 Monate her #135076 von keunes
keunes antwortete auf das Thema: array filter for array values
Yes, that did the trick :)
Thanks for the explanation!

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha