- Posts: 26
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Exclusive option in Array (Numbers) with checkboxes
- Episteme Investigación e Intervención Social
- Topic Author
- Offline
- Junior Member
Less
More
1 year 1 week ago #242781
by Episteme Investigación e Intervención Social
Exclusive option in Array (Numbers) with checkboxes was created by Episteme Investigación e Intervención Social
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi,
I am using an Array (numbers) with checkboxes and it would be perfect to add an exclusive option there. I saw that option in Array, multiple choice, etc; but I would like to have it in Array (numbers). For example, I am trying to have "No response" as exclusive option but I can't use Array type because I would like to have more than one option per column selected, in exception of "No response". See the file attached.
Would that be possible?
Thank you for your attention and help.
Best regards,
Aida Longan.
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi,
I am using an Array (numbers) with checkboxes and it would be perfect to add an exclusive option there. I saw that option in Array, multiple choice, etc; but I would like to have it in Array (numbers). For example, I am trying to have "No response" as exclusive option but I can't use Array type because I would like to have more than one option per column selected, in exception of "No response". See the file attached.
Would that be possible?
Thank you for your attention and help.
Best regards,
Aida Longan.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10115
- Thank you received: 3597
1 year 1 week ago - 1 year 1 week ago #242786
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Exclusive option in Array (Numbers) with checkboxes
See this post -
forums.limesurvey.org/index.php/forum/ca...erical-matrix#218665
You will need to modify the script for a single exclusive row.
Change this:
To this:
You will need to modify the script for a single exclusive row.
Change this:
Code:
$('tr.subquestion-list', thisQuestion).slice(-2).find('td.answer-item').addClass('exclusive-item');
To this:
Code:
$('tr.subquestion-list:last', thisQuestion).find('td.answer-item').addClass('exclusive-item');
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 1 year 1 week ago by tpartner.
Please Log in to join the conversation.
- Episteme Investigación e Intervención Social
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 0
1 year 1 week ago - 1 year 1 week ago #242792
by Episteme Investigación e Intervención Social
Replied by Episteme Investigación e Intervención Social on topic Exclusive option in Array (Numbers) with checkboxes
Thanks, tpartner for your quick response. Your reply helped a lot. Just one more thing, I would also like to limit the responses to just two columns instead of having the possibility of cheking all boxes in all 4 columns. For example, if the participant responds to the column 1 and 2 (Madre, Padre), he can't respond to the columns 3 and 4 (Madre 2, Padre 2). Or should I open a new topic? Thanks again.
Last edit: 1 year 1 week ago by Episteme Investigación e Intervención Social.
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12996
- Thank you received: 3999
1 year 1 week ago - 1 year 1 week ago #242799
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Exclusive option in Array (Numbers) with checkboxes
You may validate.
Something like
sum(if(count(self.sq_X001.NAOK)>0,1,0),if(count(self.sq_X002.NAOK)>0,1,0),if(count(self.sq_X003.NAOK)>0,1,0),if(count(self.sq_X004.NAOK)>0,1,0)) < 3
y-axis coded "Y001", "Y002",...
x-axis coded "X001", "X002",...
Joffm
Something like
sum(if(count(self.sq_X001.NAOK)>0,1,0),if(count(self.sq_X002.NAOK)>0,1,0),if(count(self.sq_X003.NAOK)>0,1,0),if(count(self.sq_X004.NAOK)>0,1,0)) < 3
y-axis coded "Y001", "Y002",...
x-axis coded "X001", "X002",...
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 1 week ago by Joffm.
Please Log in to join the conversation.
- Episteme Investigación e Intervención Social
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 0
1 year 1 week ago #242802
by Episteme Investigación e Intervención Social
Replied by Episteme Investigación e Intervención Social on topic Exclusive option in Array (Numbers) with checkboxes
Thanks for your quick response. I changed the X axis codes like that:
sum(if(count(self.sq_ma.NAOK)>0,1,0),if(count(self.sq_pa.NAOK)>0,1,0),if(count(self.sq_ma2.NAOK)>0,1,0),if(count(self.sq_pa2.NAOK)>0,1,0)) < 3
where my x-axis where coded as "X001" was "ma", "X002" as "pa", "X003" as "ma2" and "X004" as "pa2".
I add it in the box called: Subquestion Validation Equiation but it doesn't work. Did I miss something?
sum(if(count(self.sq_ma.NAOK)>0,1,0),if(count(self.sq_pa.NAOK)>0,1,0),if(count(self.sq_ma2.NAOK)>0,1,0),if(count(self.sq_pa2.NAOK)>0,1,0)) < 3
where my x-axis where coded as "X001" was "ma", "X002" as "pa", "X003" as "ma2" and "X004" as "pa2".
I add it in the box called: Subquestion Validation Equiation but it doesn't work. Did I miss something?
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12996
- Thank you received: 3999
1 year 1 week ago #242804
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Exclusive option in Array (Numbers) with checkboxes
"ma" and "ma2" is not the best choice.
Why? Because "ma2" also contains "ma" and "count(self.sq_ma.NAOK)" will count "ma" and "ma2".
Please read the manual about the variables ".self" and ".that"
[url] manual.limesurvey.org/ExpressionScript_-....22that.22_variables [/url]
If it still doesn't work, please send the lss export of your survey.
Joffm
Why? Because "ma2" also contains "ma" and "count(self.sq_ma.NAOK)" will count "ma" and "ma2".
Please read the manual about the variables ".self" and ".that"
[url] manual.limesurvey.org/ExpressionScript_-....22that.22_variables [/url]
If it still doesn't work, please send the lss export of your survey.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- Episteme Investigación e Intervención Social
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 0
1 year 1 week ago #242815
by Episteme Investigación e Intervención Social
Replied by Episteme Investigación e Intervención Social on topic Exclusive option in Array (Numbers) with checkboxes
I still have the same problem, I send you the .lsq format.
Thank you very much.
Thank you very much.
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12996
- Thank you received: 3999
1 year 1 week ago - 1 year 1 week ago #242816
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Exclusive option in Array (Numbers) with checkboxes
lsg and lsq exports are language sensitive.
To ease our work we therefore always ask for lss.
"language sensitive" means:
You can't import a lsq or lsg export into a survey with a different base language.
So we have to guess the base language of your export, create a survey, create a group to be able to import.your lsq export.
Furthermore these exports don't contain surveywide settings which may be important, too.
Joffm
To ease our work we therefore always ask for lss.
"language sensitive" means:
You can't import a lsq or lsg export into a survey with a different base language.
So we have to guess the base language of your export, create a survey, create a group to be able to import.your lsq export.
Furthermore these exports don't contain surveywide settings which may be important, too.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 1 week ago by Joffm.
Please Log in to join the conversation.
- Episteme Investigación e Intervención Social
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 0
1 year 1 week ago #242830
by Episteme Investigación e Intervención Social
Replied by Episteme Investigación e Intervención Social on topic Exclusive option in Array (Numbers) with checkboxes
Okey, makes a lot of sense. Here I attached the .lss format. The problema is with the last question of the first question group. I attached the details:
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12996
- Thank you received: 3999
1 year 1 week ago #242832
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Exclusive option in Array (Numbers) with checkboxes
This is simply wrong syntax.
At least ot is like
!is_empty(Q1_ma_7) or whatever code you used.
At least ot is like
!is_empty(Q1_ma_7) or whatever code you used.
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- Episteme Investigación e Intervención Social
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 0
1 year 1 week ago #242833
by Episteme Investigación e Intervención Social
Replied by Episteme Investigación e Intervención Social on topic Exclusive option in Array (Numbers) with checkboxes
Hi Joffm,
My question code is: ocuprog
and the subquestion codes are: ma, pa, segm, segp (the 4 columns in the Array, X-Scale).
I'm not sure why do you include the number 7 there:
"!is_empty(Q1_ma_7)".
Thank you!
My question code is: ocuprog
and the subquestion codes are: ma, pa, segm, segp (the 4 columns in the Array, X-Scale).
I'm not sure why do you include the number 7 there:
"!is_empty(Q1_ma_7)".
Thank you!
Please Log in to join the conversation.
- Episteme Investigación e Intervención Social
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 0
1 year 1 week ago #242834
by Episteme Investigación e Intervención Social
Replied by Episteme Investigación e Intervención Social on topic Exclusive option in Array (Numbers) with checkboxes
I changed the code values as you said to make this easier as follows:
Question code as Q1 and subquestions as X01, X02, X03 and X04. And copied your code as your previous reply:
It still doesn't work.
I don't know if an HTML code I have might be interfering. I have that to make last subquestion in the Y-axe exclusive as it is "No response".
Thank you again
Question code as Q1 and subquestions as X01, X02, X03 and X04. And copied your code as your previous reply:
It still doesn't work.
I don't know if an HTML code I have might be interfering. I have that to make last subquestion in the Y-axe exclusive as it is "No response".
Thank you again
Please Log in to join the conversation.