- Posts: 58
- Thank you received: 3
"Exclusive option" in array
- delarammahdaviii
-
Topic Author
- Offline
- Senior Member
-
Less
More
4 years 11 months ago #130390
by delarammahdaviii
"Exclusive option" in array was created by delarammahdaviii
hi
thanks for
i want use "Exclusive option" in array but for answer code , not for subquestion code
how can do it ?
thanks for
i want use "Exclusive option" in array but for answer code , not for subquestion code
how can do it ?
The topic has been locked.
Less
More
- Posts: 9799
- Thank you received: 3131
4 years 11 months ago #130395
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Replied by tpartner on topic "Exclusive option" in array
Sorry, I don't understand the question. In an array, the answer options are already exclusive because they're radios.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The topic has been locked.
- delarammahdaviii
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 58
- Thank you received: 3
4 years 11 months ago - 4 years 11 months ago #130397
by delarammahdaviii
Replied by delarammahdaviii on topic "Exclusive option" in array
In an array (single choice per rows); i want choice answer in column , if one of the answer in D column is choose , another rows can't choose the answer D column .
Last edit: 4 years 11 months ago by delarammahdaviii.
The topic has been locked.
Less
More
- Posts: 9799
- Thank you received: 3131
4 years 11 months ago #130399
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Replied by tpartner on topic "Exclusive option" in array
Just for column D, or for all columns?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The topic has been locked.
- delarammahdaviii
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 58
- Thank you received: 3
4 years 11 months ago #130400
by delarammahdaviii
Replied by delarammahdaviii on topic "Exclusive option" in array
Just for column D
The topic has been locked.
Less
More
- Posts: 9799
- Thank you received: 3131
4 years 11 months ago - 4 years 11 months ago #130407
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Replied by tpartner on topic "Exclusive option" in array
In that case, adding this script to the question source should do the trick:
Sample survey attached.
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Identify this question
var thisQuestion = $('#question{QID}');
// Assign column-specific classes
$('table.subquestions-list tr', thisQuestion).each(function(i){
$('> *', this).each(function(i){
$(this).addClass('column-'+i+'');
$(this).attr('data-column', i);
});
});
// Define the column to have exclusive answers
var exclusiveColumn = 4;
// Listeners on the radios
$('input.radio', thisQuestion).on('click', function(e) {
var thisCell = $(this).closest('td');
if($(thisCell).hasClass('column-'+exclusiveColumn)) {
setTimeout(function () {
$('.column-'+exclusiveColumn+' input.radio:not(:checked)', thisQuestion).prop('disabled', true);
}, 100);
}
if($('.column-'+exclusiveColumn+' input.radio:checked', thisQuestion).length == 0) {
$('.column-'+exclusiveColumn+' input.radio', thisQuestion).prop('disabled', false);
}
});
// Initial radio state
if($('.column-'+exclusiveColumn+' input.radio:checked', thisQuestion).length != 0) {
$('.column-'+exclusiveColumn+' input.radio:not(:checked)', thisQuestion).prop('disabled', true);
}
});
</script>
Sample survey attached.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 4 years 11 months ago by tpartner.
The following user(s) said Thank You: delarammahdaviii
The topic has been locked.
- DenisChenu
-
- Away
- LimeSurvey Community Team
-
Less
More
- Posts: 13999
- Thank you received: 2475
4 years 11 months ago - 4 years 11 months ago #130445
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
Replied by DenisChenu on topic "Exclusive option" in array
ANd with EM (for PHP validation too (user deactivated javascript)
Question validation equation
Question validation equation
countif("d",self.NAOK) <= 1
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
Last edit: 4 years 11 months ago by DenisChenu.
The topic has been locked.
Less
More
- Posts: 9799
- Thank you received: 3131
4 years 11 months ago - 4 years 11 months ago #130462
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Replied by tpartner on topic "Exclusive option" in array
Yeah but I think the user experience with disabled radios is better.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 4 years 11 months ago by tpartner.
The following user(s) said Thank You: delarammahdaviii
The topic has been locked.
4 years 11 months ago #130469
by Mazi
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com
Want to use your survey offline -> www.offlinesurveys.com
Replied by Mazi on topic "Exclusive option" in array
Denis, is that a custom validation for making sure that at the whole question option "d" is used only once?DenisChenu wrote: ANd with EM (for PHP validation too (user deactivated javascript)
Question validation equationcountif("d",self.NAOK) <= 1
Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com
Want to use your survey offline -> www.offlinesurveys.com
The topic has been locked.
- DenisChenu
-
- Away
- LimeSurvey Community Team
-
Less
More
- Posts: 13999
- Thank you received: 2475
4 years 11 months ago #130500
by DenisChenu
. Else a user can decativate JS (or js can be broken for some reason
) and false value in DB.
I try always to
- Add specific desired behaviour in EM first
- Add some js for user experience
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
Replied by DenisChenu on topic "Exclusive option" in array
YesMazi wrote: ....
Denis, is that a custom validation for making sure that at the whole question option "d" is used only once?
Sure, but : need a PHP controltpartner wrote: Yeah but I think the user experience with disabled radios is better.


I try always to
- Add specific desired behaviour in EM first
- Add some js for user experience

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The topic has been locked.
Less
More
- Posts: 9799
- Thank you received: 3131
4 years 11 months ago #130506
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Replied by tpartner on topic "Exclusive option" in array
Well, with JavaScript disabled LimeSurvey is almost useless anyway - there is no dynamic filtering or EM.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The topic has been locked.
- delarammahdaviii
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 58
- Thank you received: 3
4 years 11 months ago - 4 years 11 months ago #130530
by delarammahdaviii
Replied by delarammahdaviii on topic "Exclusive option" in array
hi
tnx all for reply:)

i so sorry this case is change
if one of the D column is select ; C and B else disable .user only can select from A or E
tnx all for reply:)


i so sorry this case is change
if one of the D column is select ; C and B else disable .user only can select from A or E
Last edit: 4 years 11 months ago by delarammahdaviii.
The topic has been locked.
- EnricoCaruso
-
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
1 year 5 months ago #187895
by EnricoCaruso
Replied by EnricoCaruso on topic "Exclusive option" in array
The script and sample survey currently do not work with LimeSurvey version 3.17.9. I can not find what's going on. Maybe there is a version conflict here.
The topic has been locked.
1 year 5 months ago - 1 year 5 months ago #187902
by Joffm
This thread ended three and a half years ago and the screenshot shows a template of version 2.05 / 2.06 (I think)
So please add your sample survey as *.lss, explain what you want to do, and we will try to find a solution.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic "Exclusive option" in array
Yes, this is very probable.Maybe there is a version conflict here.
This thread ended three and a half years ago and the screenshot shows a template of version 2.05 / 2.06 (I think)
So please add your sample survey as *.lss, explain what you want to do, and we will try to find a solution.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 1 year 5 months ago by Joffm.
The following user(s) said Thank You: EnricoCaruso
The topic has been locked.
- EnricoCaruso
-
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
1 year 5 months ago #187934
by EnricoCaruso
Replied by EnricoCaruso on topic "Exclusive option" in array
A rating of individual statements is required, with simultaneous distribution of the ranking (exclusive answer per column, except last column). The script from tpartner
tpartner on topic Need a replacement for Ranking Questionhere
goes in the right direction, only it works for all columns. I can not get an exception for the last column. The solution in this forum where the individual Exclusive columns can be specified is good, but it does not work.
Attachments:
The topic has been locked.