Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Descriptive options to Yes/No questions and Security?

More
4 years 1 month ago - 4 years 1 month ago #195060 by zenny
Hi,


1. How can one create multiple descriptive options to yes/no questions? I meant a question has radio button options to select yes/no, but every yes and no has multiple descriptive options to validate either yes and no options. Take for example:

Q: LimeSurvey is a useful tool:

Answers:

(radio button) Yes, because (check all that apply:
(checkbox1) It can be SELF-HOSTED.
(checkbox2) It is OPEN SOURCED.
(checkbox3) It is SUPERIOR to alternavives

(radio button) No, because (check all that apply):
(checkbox4) It has STEEP LEARNING CURVE.
(checkbox5) It requires PROGRAMMING KNOWLEDGE.
(checkbox6) It lacks FEATURES I need.


However, when a respondent choose either one should also be restricted from the relevant checkbox option in another or vice versa. Any clues?


2. What mechanisms are there to prevent automated bots in LimeSurvey (either a simple math or image captcha) which has been well-tested?

Thanks, and Cheers,
/z
Last edit: 4 years 1 month ago by zenny.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago #195062 by tpartner
1) Possible with significant JavaScript but not available out of the box.

2) Captcha on token public registration - manual.limesurvey.org/Survey_participant..._public_registration

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
4 years 1 month ago - 4 years 1 month ago #195064 by zenny
@tparner: Thanks, but taken note with surprise that why hierarchical options were not addressed earlier in a very powerful application like LimeSurvey!?

Anyway my wishful thinking can be interpreted as a feature request (also see www.limesurvey.org/forum/future-features...-mixed-reply-options )! ;-)

Cheers, and have a nice weekend.
Last edit: 4 years 1 month ago by zenny.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago - 4 years 1 month ago #195069 by Joffm
Well,
you can do it in 2- or 3-Levels.





The only thing is: You have to validate that not "Yes" AND "No" are selected.

But even the - high priced - commercial tool we use doesn't have this feature.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 1 month ago by Joffm.
The following user(s) said Thank You: zenny
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago #195074 by Joffm
Hi,
I think this fulfills your wish.

However, when a respondent choose either one should also be restricted from the relevant checkbox option in another or vice versa.








And if the primary checkbox is unchecked you see the initial "Yes/No" again.

I added a little bit to this - custom - workaround that you find here:
manual.limesurvey.org/Workarounds:_Manip...meSurvey_version_3.x
Code:
<script type="text/javascript" charset="utf-8">
// A function to handle "secondary" checkboxes
function secondaryCheckboxes(qID, primaryPosition, secondaryCount,primaryHide) {
  // Identify the elements
  var thisQuestion = $('#question'+qID);
  var primaryRow = $('li.question-item:eq('+(primaryPosition-1)+')', thisQuestion).closest('li.question-item');
  var primaryInput = $('input:checkbox', primaryRow);
  var secondaryRows = primaryRow.nextAll('li.question-item:lt('+(secondaryCount)+')');
  var secondaryInputs = $('input:checkbox', secondaryRows);
 
  var primaryHRow = $('li.question-item:eq('+(primaryHide-1)+')', thisQuestion).closest('li.question-item');
 
 
  // Indent the secondaries
  secondaryRows.css({ 'margin-left':'2.5em' });
 
  // Initial states of the secondary answers
  if (primaryInput.prop('checked') == false ) {
    secondaryRows.hide(); 
  } 
 
  // A listener on the primary answer to show or hide secondary answers 
  primaryInput.on('change', function (event) { 
 
    // Hide/show the secondary answers accordingly
    if (!$(this).is(':checked')) {
      primaryHRow.show(); 
      secondaryRows.hide();        
      secondaryInputs.prop('checked', false).trigger('change');
    }
    else {
      secondaryRows.show(); 
      primaryHRow.hide();        
    }
  });
} 
  $(document).ready(function() {
    // Sub-question 1 is primary followed by 3 secondaries
    // Sub-question 5 is to hide if 1 is checked
    secondaryCheckboxes({QID}, 1, 3, 5);
    // Sub-question 5 is primary followed by 3 secondaries    
    // Sub-question 1 is to hide if 5 is checked
    secondaryCheckboxes({QID}, 5, 3, 1);
    });  
</script>

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: zenny
The topic has been locked.
More
4 years 1 month ago #195082 by zenny

Joffm wrote: Hi,
I think this fulfills your wish.

However, when a respondent choose either one should also be restricted from the relevant checkbox option in another or vice versa.








And if the primary checkbox is unchecked you see the initial "Yes/No" again.

I added a little bit to this - custom - workaround that you find here:
manual.limesurvey.org/Workarounds:_Manip...meSurvey_version_3.x
Code:
<script type="text/javascript" charset="utf-8">
// A function to handle "secondary" checkboxes
function secondaryCheckboxes(qID, primaryPosition, secondaryCount,primaryHide) {
  // Identify the elements
  var thisQuestion = $('#question'+qID);
  var primaryRow = $('li.question-item:eq('+(primaryPosition-1)+')', thisQuestion).closest('li.question-item');
  var primaryInput = $('input:checkbox', primaryRow);
  var secondaryRows = primaryRow.nextAll('li.question-item:lt('+(secondaryCount)+')');
  var secondaryInputs = $('input:checkbox', secondaryRows);
 
  var primaryHRow = $('li.question-item:eq('+(primaryHide-1)+')', thisQuestion).closest('li.question-item');
 
 
  // Indent the secondaries
  secondaryRows.css({ 'margin-left':'2.5em' });
 
  // Initial states of the secondary answers
  if (primaryInput.prop('checked') == false ) {
    secondaryRows.hide(); 
  } 
 
  // A listener on the primary answer to show or hide secondary answers 
  primaryInput.on('change', function (event) { 
 
    // Hide/show the secondary answers accordingly
    if (!$(this).is(':checked')) {
      primaryHRow.show(); 
      secondaryRows.hide();        
      secondaryInputs.prop('checked', false).trigger('change');
    }
    else {
      secondaryRows.show(); 
      primaryHRow.hide();        
    }
  });
} 
  $(document).ready(function() {
    // Sub-question 1 is primary followed by 3 secondaries
    // Sub-question 5 is to hide if 1 is checked
    secondaryCheckboxes({QID}, 1, 3, 5);
    // Sub-question 5 is primary followed by 3 secondaries    
    // Sub-question 1 is to hide if 5 is checked
    secondaryCheckboxes({QID}, 5, 3, 1);
    });  
</script>

Joffm



@Joffm: Thanks for your kindness with the inputs. However, we tried to mimic a similar thing in the google forms where, the first part was Yes/No radio options and the second part is the descriptive. But when tested among some respondents, they find this way no appliable in particularly in the field of linguistic survey.

Danke Vielen, Herr @Joffm!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose