Welcome to the LimeSurvey Community Forum

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

Multiple Other Options & Randomized Answers

  • BBCMResearch
  • BBCMResearch's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 4 months ago - 7 years 4 months ago #145985 by BBCMResearch
Multiple Other Options & Randomized Answers was created by BBCMResearch
Hello again,

I'm currently trying to work out a few issues that are related to the "Other Option" in radio and multiple choice questions.

1) Can I add a second 'other' to one question? For instance, I have a radio list, and the last two answer options should read:

General information (please specify) [TEXT BOX]
Other, please specify [TEXT BOX]

2) The answers in this radio list are randomized. Generally the Other option always appears at the bottom of a randomized list, which is perfect. However, I need the "General information" option to be one of the randomized answers.

Thanks for your help.
Last edit: 7 years 4 months ago by BBCMResearch.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
7 years 4 months ago #145999 by Mazi
@1: This isn't possible.

@2: In this case you have to code some lines of additional JavaScript to randomly place the other options somewhere else.
This may be a first start: www.limesurvey-consulting.com/how-to-re-...a-limesurvey-survey/
You only need to randomly determine the place the other item should be placed.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • BBCMResearch
  • BBCMResearch's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 4 months ago #146057 by BBCMResearch
Replied by BBCMResearch on topic Multiple Other Options & Randomized Answers
Alright, let me try again - would it be possible to program this question as a 'multiple choice with comments' style question, and then selectively hide the comments/text boxes from all but one of the answers?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #146059 by holch
Yes.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago - 7 years 4 months ago #146060 by holch
Yes. There should be plenty of examples in the forum.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 7 years 4 months ago by holch.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #146061 by holch
And there is even an example in the manual for doing exactly this:
manual.limesurvey.org/Workarounds:_Quest...comments.22_question

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu, BBCMResearch
The topic has been locked.
  • BBCMResearch
  • BBCMResearch's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 4 months ago #146065 by BBCMResearch
Replied by BBCMResearch on topic Multiple Other Options & Randomized Answers
Thank you Holch, exactly what I was looking for!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #146071 by DenisChenu
Replied by DenisChenu on topic Multiple Other Options & Randomized Answers
I note for my todo list : a plugin with 'question attribute/adv settings' :
hide comment of sub-question :
You can set the list of subquestion hidden (SQ001,SQ002,SQ006 for example=

Good idea :)

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.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 4 months ago #146081 by holch
And then we just need a list radio with comments for each option and the possibiity to hide it via the same plugin.

But to be honest, I think the option to have more than one comment field / other field should be part of the main package, for multiple choice and single choice questions. It is a pretty standard requirement in research and not something that should require the installation of a specific plugin.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • BBCMResearch
  • BBCMResearch's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 3 months ago #146100 by BBCMResearch
Replied by BBCMResearch on topic Multiple Other Options & Randomized Answers
Thanks for the help guys, I have one added complication - partially randomized answers.

I currently have an 'Other' option that needs to be pegged at the bottom, however, I can't seem to get the 'multiple choice' workaround to work for 'multiple choice with comments.'

Also, all of these subquestions have to be exclusive options.

Thoughts?

My source code currently reads:
Code:
Question
<script type="text/javascript" charset="utf-8">  
 
  $(document).ready(function() {
 
    // The number of answers to be fixed at the end of the list
    var fixedAnswers = 1;
 
    // Identify this question
    var qID = {QID}; 
 
    // Find the number of answers
    var ansCount = $('#question'+qID+' .answer-item').length;
 
    // Place the last n answers created at the end of the list
    var fixedIndex = fixedAnswers - 1;
    for (var i=0; i<fixedAnswers; i++) {
      var answer = $('input[id^="answer"][id$="X'+qID+(ansCount-fixedIndex)+'"]');
      var answerItem = $(answer).closest('.answer-item');
      var answersList = $(answer).closest('.answers-list');
      if($('#question'+qID).hasClass('multiple-opt')) {
        answerItem = $(answer).closest('.answer-item').parent();
        answersList = $(answer).closest('.subquestion-list');
      }
      $(answersList).append(answerItem);
      fixedIndex--;
    }    
  });
</script><script>
$(function() {
  $("#answer{SGQ}1comment").hide();
});
</script><script>
$(function() {
  $("#answer{SGQ}2comment").hide();
});
</script><script>
$(function() {
  $("#answer{SGQ}3comment").hide();
});
</script><script>
$(function() {
  $("#answer{SGQ}4comment").hide();
});
</script>
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146109 by DenisChenu
Replied by DenisChenu on topic Multiple Other Options & Randomized Answers

holch wrote: But to be honest, I think the option to have more than one comment field / other field should be part of the main package, for multiple choice and single choice questions. It is a pretty standard requirement in research and not something that should require the installation of a specific plugin.

Hi,

I think a clean system is
  1. Make a clean, with just the necessary question type/option core system
  2. Add a lot of system to extend this part
  3. Put some extensions (activatable) in core

Then you have a system where
- Basic using of system is easy, and don't take a lot of time to understand
- Easily extandable by user (just go to settings/extensions and activate what you need)
- Easily extandable by dev (create new plugins/extension)

An LS example :

Participant DB in 2.51 :
  • You have a 'filter' popup windons with all column (not only visible columns) screen 250_1.png
  • You can move all filtered Particpant to a survey (not only the checked ones) screen 250_2.png
Participant DB in 2.57 : you loose all this sytem.

Loosing system is not really bad for Core Dev. But for some user's they lost a system they really need : the only solution : stay in LS 2.52.

If all of this system are in an extension (the CPDB) managed by core team : we can update CPDB core plugins, but user with old behaviour need have a solution to have LS at last version + old CPDB system.

All actual big CMS is like that :
- core offer very little part
- core offer some 'activatable' plugins/extensions
- core offer a lot of way to add plugins/extensions

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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146118 by tpartner
Replied by tpartner on topic Multiple Other Options & Randomized Answers

I currently have an 'Other' option that needs to be pegged at the bottom, however, I can't seem to get the 'multiple choice' workaround to work for 'multiple choice with comments.'

Try this updated script which should also handle multiple choice with comments.

Code:
<script type="text/javascript" charset="utf-8">  
 
  $(document).ready(function() {
 
    // The number of answers to be fixed at the end of the list
    var fixedAnswers = 1;
 
    // Identify this question
    var qID = {QID}; 
 
    // Find the number of answers
    var ansCount = $('#question'+qID+' .answer-item').length;
 
    // Place the last n answers created at the end of the list
    var fixedIndex = fixedAnswers - 1;
    for (var i=0; i<fixedAnswers; i++) {
      var answer = $('input[id^="answer"][id$="X'+qID+(ansCount-fixedIndex)+'"]');
      var answerItem = $(answer).closest('.answer-item');
      var answersList = $(answer).closest('.answers-list');
      if($('#question'+qID).hasClass('multiple-opt')) {
        answerItem = $(answer).closest('.answer-item').parent();
        answersList = $(answer).closest('.subquestion-list');
      }
      if($('#question'+qID).hasClass('multiple-opt-comments')) {
        answersList = $(answer).closest('tbody');
      }
      $(answersList).append(answerItem);
      fixedIndex--;
    }    
  });
</script>

Also, all of these subquestions have to be exclusive options.

Why not use single choice with comments?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose