- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Choix multiples_Réponses contradictoire_Indication de validation de la question
- margot1234
- Topic Author
- Offline
- New Member
Less
More
6 months 23 hours ago #251575
by margot1234
Choix multiples_Réponses contradictoire_Indication de validation de la question was created by margot1234
Bonjour.
J'ai une question à choix multiples de type. J'aimerai empêcher les répondants de cocher une réponse en particulier s'ils ont coché une autre qui est contradictoire.
Ex:
- a
- b
- c
- d
Je veux empêcher le répondant de cocher b s'il a déjà coché a et inversement je veux l'empêcher de cocher a s'il a coché b. Comment est-ce que je peux faire cela ?
Je suppose que je dois indiqué une équation dans la validation de la question mais je n'y parviens pas...
Merci!
J'ai une question à choix multiples de type. J'aimerai empêcher les répondants de cocher une réponse en particulier s'ils ont coché une autre qui est contradictoire.
Ex:
- a
- b
- c
- d
Je veux empêcher le répondant de cocher b s'il a déjà coché a et inversement je veux l'empêcher de cocher a s'il a coché b. Comment est-ce que je peux faire cela ?
Je suppose que je dois indiqué une équation dans la validation de la question mais je n'y parviens pas...
Merci!
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12943
- Thank you received: 3979
6 months 22 hours ago #251577
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Choix multiples_Réponses contradictoire_Indication de validation de la question
Please, English in this part of the forum.
Or use the French part.
Joffm
Or use the French part.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- margot1234
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
6 months 22 hours ago #251578
by margot1234
Replied by margot1234 on topic Choix multiples_Réponses contradictoire_Indication de validation de la question
Hello. Sorry I don't know that. So,
I have a multiple choice question. I would like to block respondents from checking a particular answer if they have checked another that is contradictory.
Ex:
- a
- b
- c
- d
I want to stop the respondent from ticking b if he has already ticked a and inversely I want to stop him ticking a if he has ticked b. How can I do this?
I suppose I need to enter an equation in the question validation, but I can't manage it...
Thanks for your help!
I have a multiple choice question. I would like to block respondents from checking a particular answer if they have checked another that is contradictory.
Ex:
- a
- b
- c
- d
I want to stop the respondent from ticking b if he has already ticked a and inversely I want to stop him ticking a if he has ticked b. How can I do this?
I suppose I need to enter an equation in the question validation, but I can't manage it...
Thanks for your help!
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12943
- Thank you received: 3979
6 months 22 hours ago #251579
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Choix multiples_Réponses contradictoire_Indication de validation de la question
Hi, the easy solution is to validate
Here two validations:
a. !(Q1_SQ001.NAOK=="Y" and Q1_SQ002.NAOK=="Y") not both selected
b. count(Q1_SQ001.NAOK,Q1_SQ002.NAOK)<2 the number of selected items is less than 2, so only one of them or none
There might be more solutions by javascript, which disable a subquestion if the other one was selected.
Joffm
Here two validations:
a. !(Q1_SQ001.NAOK=="Y" and Q1_SQ002.NAOK=="Y") not both selected
b. count(Q1_SQ001.NAOK,Q1_SQ002.NAOK)<2 the number of selected items is less than 2, so only one of them or none
There might be more solutions by javascript, which disable a subquestion if the other one was selected.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
Please Log in to join the conversation.
- margot1234
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
6 months 22 hours ago #251580
by margot1234
Replied by margot1234 on topic Choix multiples_Réponses contradictoire_Indication de validation de la question
Thanks. That's what I tried but I got an error message... (error 403)
Attachments:
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12943
- Thank you received: 3979
6 months 22 hours ago #251581
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Choix multiples_Réponses contradictoire_Indication de validation de la question
What image is this?
If you get an error message, please send the lss export
Joffm
If you get an error message, please send the lss export
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- holch
- Online
- LimeSurvey Community Team
Less
More
- Posts: 11661
- Thank you received: 2742
6 months 20 hours ago #251583
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Choix multiples_Réponses contradictoire_Indication de validation de la question
This seems to be a custom 403 error message from your server.
You need to check with your server admin.
HTTP 403 is an HTTP status code meaning access to the requested resource is forbidden.
You need to check with your server admin.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.
- margot1234
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
6 months 18 hours ago #251584
by margot1234
Replied by margot1234 on topic Choix multiples_Réponses contradictoire_Indication de validation de la question
Ok, I'm going to check. Thank you for your help!
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 months 4 weeks ago #251669
by tpartner
Modify the values in the exclusiveCodes array as necessary.
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Choix multiples_Réponses contradictoire_Indication de validation de la question
This small script, placed in the source of a multiple-choice question, will render various answer items as exclusive by disabling other exclusive items.There might be more solutions by javascript, which disable a subquestion if the other one was selected.
Modify the values in the exclusiveCodes array as necessary.
Code:
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Define the exclusive sub-question codes var exclusiveCodes = [ 'SQ001', 'SQ002' ]; // Identify this question var qID = '{QID}'; var thisQuestion = $('#question'+qID); // Add some classes $.each(exclusiveCodes, function(i, code) { $(':checkbox[id$="X'+qID+code+'"]', thisQuestion).addClass('exclusive-input'); }); // Listener on the exclusive items $(':checkbox.exclusive-input', thisQuestion).on('change', function(e) { handleExclusive(thisQuestion); }); // Returning to the page handleExclusive(thisQuestion); }); // A function to handle the exclusive items function handleExclusive(thisQuestion) { $(':checkbox.exclusive-input', thisQuestion).prop('disabled', false); if($(':checkbox.exclusive-input:checked', thisQuestion).length > 0) { $(':checkbox.exclusive-input: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.
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 months 3 weeks ago - 5 months 3 weeks ago #251722
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 Choix multiples_Réponses contradictoire_Indication de validation de la question
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.
Attachments:
Last edit: 5 months 3 weeks ago by DenisChenu.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 months 3 weeks ago #251737
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 Choix multiples_Réponses contradictoire_Indication de validation de la question
Sure, if you want to modify the display rules for irrelevant items.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Please Log in to join the conversation.