Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: multiple)

  • Joffm
  • Joffm's Avatar
11 Aug 2023 15:37
Oh, yes,
ChatGPT always makes us laugh.
  • Oterito
  • Oterito's Avatar
11 Aug 2023 15:15 - 11 Aug 2023 15:20
Thanks Joffm!! I would try this solution.

I tried generate some code with chat gpt but it didn't work.

<script type="text/javascript">
    $(document).ready(function() {
        // Get the options container of the question
        var optionsContainer = $('.question{QID} .answer-list');

        // Arrays for options in each group
        var group1Options = ; // Replace with the actual option values
        var group2Options = ; // Replace with the actual option values
        var otherOptions = [];

        // Filter options based on groups
        optionsContainer.find('.answer-item').each(function() {
            var optionValue = $(this).find('input[type="radio"]').val();

            if (group1Options.includes(optionValue)) {
                group1Options.push($(this));
            } else if (group2Options.includes(optionValue)) {
                group2Options.push($(this));
            } else {
                otherOptions.push($(this));
            }
        });

        // Function to shuffle an array
        function shuffleArray(array) {
            for (var i = array.length - 1; i > 0; i--) {
                var j = Math.floor(Math.random() * (i + 1));
                var temp = array;
                array = array[j];
                array[j] = temp;
            }
        }

        // Shuffle the two groups separately
        shuffleArray(group1Options);
        shuffleArray(group2Options);

        // Empty the container and add the randomized options
        optionsContainer.empty().append(group1Options).append(group2Options).append(otherOptions);
    });
</script>


:(
  • Joffm
  • Joffm's Avatar
11 Aug 2023 09:12
No, I don't.
Therefore I use the easy solution.
Split the question.

Use two "multiple" questions with "Other" option and merge them with the css classes "no-bottom" in the first and "no-question" in the second.
Code:
<style>
.no-question { border-top:0; }
.no-question .question-title-container,
.no-question .question-valid-container {
    display:none;
}
.no-question .answer-container {
    padding-top: 0em;
    padding-bottom: 0.5em;
}
.no-bottom {
    border-bottom:0;
    margin-bottom:0;
}
.no-bottom .answer-container {
    padding-bottom: 0em;
}
</style>

Change the script to enter the subheaders
from
$('.checkbox-text-item:eq(0)', thisQuestion).before(...
to
$('.checkbox-item:eq(0)', thisQuestion).before(...

You may add some more css to style it.
 

Joffm
  • raph_rf
  • raph_rf's Avatar
11 Aug 2023 03:42
This message contains secure information
  • Oterito
  • Oterito's Avatar
11 Aug 2023 00:33
Thanks Joffm, it worked perfectly!

Do you know how can i randomize the two groups of subquestions in that case?
  • Joffm
  • Joffm's Avatar
10 Aug 2023 23:47 - 10 Aug 2023 23:51
Hi,
to insert subheaders you shouldn't use a subquestion and then remove things.
Better you insert a text as a new subheader.
 
Code:
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
        var SubHeading1="Subtitle 1";
        var SubHeading2="Subtitle 2";
        var thisQuestion = $('#question{QID}');
         // Insert sub-headings
        $('.checkbox-text-item:eq(0)', thisQuestion).before('<li class="inserted-sub-heading"><span class="myHeader">'+SubHeading1+'</span></li>');
        $('.checkbox-text-item:eq(4)', thisQuestion).before('<li class="inserted-sub-heading"><span class="myHeader">'+SubHeading2+'</span></li>');
    });
</script>


I used a class "myHeader" to easily style it.
Code:
<style type="text/css">
  .myHeader {
    color:maroon;
    font-size:120%;
    margin-left: 25px;
  }
</style>

 
  • Oterito
  • Oterito's Avatar
10 Aug 2023 19:21
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.31
Own server or LimeSurvey hosting: LimeSurvey hosting
Survey theme/template: Vanilla
==================
Hi, 

I would like to create a multiple choice with comments question where show the text boxes only for two subquestions, put other two subquestions as a subtitles (with bold letters and without checkboxes) and randomize the 1st "group" of subquestions below the first subtitle between them and the 2nd "group" of subquestions below the second subtitle between them. 

I attached the survey and a sample image explaining this. 

 

- For hide the text boxes i used a JS code from this forum i already used in other survey. It worked perfectly: 

$(document).ready(function() {
 
    // Identify this question
    var qID = {QID}; 
 
    // The sub-question codes to have no text input
    var sqCodes = [1, 2, 3, 4, 6, 7, 8, 9]; 
 
    // Loop through those sq codes and remove their text inputs
    $(sqCodes).each(function(i, code) {
      $('#question'+qID+' input[type="text"][id$="X'+qID+code+'comment"]').remove();
    });
      });

- For put two subquestions as a subtitles i tried to use this JS code from this forum but is not working:

<script type="text/javascript" charset="utf-8">    
 
  $(document).on('ready pjax:scriptcomplete',function(){
    // First Row
    $('#question{QID} .question-item:eq(0)').addClass('sub-header').find('input').remove();
      // Thirteen Row
    $('#question{QID} .question-item:eq(12)').addClass('sub-header').find('input').remove();
  });
</script>
<style type="text/css">.question-item.sub-header,
  .question-item.sub-header label {
    padding: 0;
    margin-bottom: 5;
    font-weight: bold;
  }
 
  .question-item.sub-header label::before,
  .question-item.sub-header label::after {
    display: none;
  }
</style>

- And I have no idea how to randomize differents groups of subquestions between them. 

If anyone can help me it would be great. 

Thank you in advance. 
  • Joffm
  • Joffm's Avatar
10 Aug 2023 18:55
Hi,
what kind of survey?
Is it an open survey, is it a closed token-based survey?

And why did you ignore the questions at the beginning?

Joffm
  • raph_rf
  • raph_rf's Avatar
10 Aug 2023 18:44 - 11 Aug 2023 03:32
Please help us help you and fill where relevant:
Your LimeSurvey version:  LimeSurvey Community Edition   Version 6.2.0 
Own server or LimeSurvey hosting:OWN
Survey theme/template:
==================
(Write here your question/remark)
I created a form named form1.
My goal is to  :
User1 user start 1 Form1 for a need, he save it in order to continue later
The same user need to start a new Form1 for another need, and save it in order to continue later
Is it possible?
Thanks!
  • Joffm
  • Joffm's Avatar
09 Aug 2023 21:38
The reason why we ask for only lss exports is:
lsq and lsg exports are language sensitive.
You can't import them into a survey with a different base language.
So, to help you, we have to
  • guess the base language
  • create a new survey
  • create a new group
  • and finally import your export
Furthermore these exports don't contain the survey wide settings which may be very important.
So, please help us to help you. We all are volunteers who try to help in our spare time.

Okay, I created something with the dual array.
 

File Attachment:

File Name: limesurvey...1852.lss
File Size:36 KB


Joffm


 
  • Joffm
  • Joffm's Avatar
09 Aug 2023 20:29
Please, neither lsq nor lsg exports.
Only lss
  • transitionsreussies
  • transitionsreussies's Avatar
09 Aug 2023 19:58
Thank you @tpartner for you answer! @Joffm, you are right about the array design, it fits best what I need to achieve with this set of subquestions.

I tried to reproduce your second example (array dual scale) but I can't find how to add a condition to the second answer scale like you did (it would be possible to answer to the second scale only if "Oui" is the answer in the first scale). I found an old post but the version of the .lss file is too old for my current version : [url] forums.limesurvey.org/forum/installation...-dual-scale-question [/url]

Also, I would like to add a default answer to the first scale ("Non" as default) and and the second scale ("Ne s'applique pas" as default), but don't know how to do it. Sorry about those simple questions :)

Here is the file I actually use :

Thank you,
  • Joffm
  • Joffm's Avatar
09 Aug 2023 16:22 - 09 Aug 2023 16:39
As @tpartner.
You CAN do that.
With the css classes "no-question" and "no-bottom" and some more css to minimize the height it may look like this
 

But better you consider a different question type.
1. An array(text) with the second column depending on first column
 

2. An array (dual scale) with drop-down layout and again the second scale depending on first scale
 

3. A two-level multiple question
 

Just some examples.

Now you may decide and afterwards send a lss export  with a prototype of this/these question/s.

Joffm
  • tpartner
  • tpartner's Avatar
09 Aug 2023 12:17
Use several multiple-choice questions, each followed by a Yes/No question.

You can use CSS to hide the question text in the multiple-choice questions and to remove spacing between paired questions.
  • transitionsreussies
  • transitionsreussies's Avatar
08 Aug 2023 21:19
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.31
Own server or LimeSurvey hosting: LimeSurvey hosting
Survey theme/template: default
==================Hello LimeSurvey community,I am currently working on a survey and trying to achieve a specific functionality. I have a multiple-choice question where respondents are asked to select various services they received to address a specific need, let's call it "Need X."For each service selected, I want to ask a Yes/No question to determine if the respondent found that service helpful in addressing "Need X." I want these Yes/No questions to appear immediately below the corresponding service option that was selected in the multiple-choice question.I've attempted to set up the survey using the available logic options, but I'm facing challenges in getting the Yes/No questions to appear directly below each selected option. Currently, the Yes/No questions are displayed after all the multiple-choice options.Could you please provide guidance on how I can achieve this setup using LimeSurvey? Specifically, how can I conditionally display Yes/No questions right below each selected multiple-choice option?Thank you in advance for your assistance!Best regards, David
Displaying 631 - 645 out of 761 results.

Lime-years ahead

Online-surveys for every purse and purpose