Welcome to the LimeSurvey Community Forum

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

Multiple Other Options & Randomized Answers

More
8 years 8 months ago - 8 years 8 months ago #145985 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: 8 years 8 months ago by BBCMResearch.
The topic has been locked.
More
8 years 8 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
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!
The topic has been locked.
More
8 years 8 months ago #146057 by BBCMResearch
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.
More
8 years 8 months ago #146059 by holch
Yes.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
8 years 8 months ago - 8 years 8 months ago #146060 by holch
Yes. There should be plenty of examples in the forum.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
Last edit: 8 years 8 months ago by holch.
The topic has been locked.
More
8 years 8 months ago #146061 by holch
And there is even an example in the manual for doing exactly this:
www.limesurvey.org/manual/Workarounds:_Q...comments.22_question

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The following user(s) said Thank You: DenisChenu, BBCMResearch
The topic has been locked.
More
8 years 8 months ago #146065 by BBCMResearch
Thank you Holch, exactly what I was looking for!
The topic has been locked.
More
8 years 8 months ago #146071 by DenisChenu
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 support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
8 years 8 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.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The topic has been locked.
More
8 years 8 months ago #146100 by BBCMResearch
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.
More
8 years 8 months ago #146109 by DenisChenu

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 support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
8 years 8 months ago #146118 by tpartner

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.
More
8 years 8 months ago #146134 by jelo

DenisChenu wrote: Make a clean, with just the necessary question type/option core system

There is no shared vision about what is necessary for a survey system like LimeSurvey.
LS GmbH isn't offering a vision beside getting LimeSurvey to the masses. There is no obligation to offer a vision, but it would help to align activities and expectations from users and developers around the LimeSurvey ecosystem. Without your own project vision is is hard to approve or decline feature requests. You can go for low hanging fruits or technical debt. But you cannot estimate demand since nobody is watching and voting for features in the bugtracker. The feature to position the other field at a different position grabbed not much attention since 2009 bugs.limesurvey.org/view.php?id=7367 . And to position just one other field is very, very common.
No workaround should be needed for that. It's not like proposing a GUI to vim developers but it sometimes feels like doing so when I see the reactions.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
8 years 8 months ago #146152 by BBCMResearch
Thanks Tony, that script did the trick!

Why not use single choice with comments?


Yeah, I thought I would do that initially, but I can't seem to find that as an available question type. I thought it would've been 'list with comment,' but that just gives me one large text box below the question for respondents to share additional thoughts.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose