Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: multiple)

  • DenisChenu
  • DenisChenu's Avatar
12 Mar 2024 16:40
Replied by DenisChenu on topic Merge multiple surveys into one
I really don't understand what you try to do.
  • stefan_o
  • stefan_o's Avatar
12 Mar 2024 16:27
Merge multiple surveys into one was created by stefan_o
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.4.12
Own server or LimeSurvey hosting: own server
Survey theme/template: fruity(?)
==================
I would like to merge multiple surveys into a single survey (due to limitations of LimeSurvey). I tried to export them as txt/csv file, copied the questions from survey B to the end of survey A, imported it, but all I see are the questions of survey A. I cannot figure out why. I even tried copying the questions to the middle: Still only the questions from survey A
  • jack56
  • jack56's Avatar
12 Mar 2024 15:01
Hey folks,

I am using the question type "multiple short text" (with 3 lines) and want to add a prefix to each line: "1:" in front of the first line, "2:" in front of the second line, "3:" in front of the third line. What kind of code (?) do I need to insert in the prefix field on the right-handed editing field to get what I want? Right now it looks like in the attached screenshot which is not what i want.

Thanks,
Jack
  • greenwoodtree
  • greenwoodtree's Avatar
12 Mar 2024 12:38
Replied by greenwoodtree on topic Create column headers - multiple choice questions
Thank you so much for your help, Joffm! I really appreciate this. I will use Option 2 as I think it is exactly what I want (Option 1 i guess would require me to disable the checkbox not just hide it in case people hover over and check it). I really love working with Limesurvey and shout-out to all you volunteers for helping us non-coders.
  • Joffm
  • Joffm's Avatar
12 Mar 2024 12:04
Hi,
there are some options:

1. Header as part of subquestion list (as your example)
Code:
<script charset="utf-8" type="text/javascript">
  $(document).ready(function() {
    $( '#question{QID} .question-item:eq(0)').addClass('hide-pseudo-elements').find('input.checkbox').remove();
    $( '#question{QID} .question-item:eq(5)').addClass('hide-pseudo-elements').find('input.checkbox').remove();
  });
</script>
 
<style type="text/css">
.hide-pseudo-elements label::before,
.hide-pseudo-elements label::after
  {
    display: none;
  }
</style>

2. With added new headers
Code:
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() { 
        var SubHeading1="<strong>Land owned/leased by you</strong>";
        var SubHeading2="<strong>Adjacent land</strong>";
        var thisQuestion = $('#question{QID}');
         // Insert sub-headings
        $('.checkbox-item:eq(0)', thisQuestion).before('<li class="inserted-sub-heading"><span>'+SubHeading1+'</span></li>');
        $('.checkbox-item:eq(4)', thisQuestion).before('<li class="inserted-sub-heading"><span>'+SubHeading2+'</span></li>');
    });
</script>

 
 

File Attachment:

File Name: limesurvey...7977.lss
File Size:49 KB

And please, do not hardcode things like SGQ-codes; use the variables
{SGQ}
{SID}
{QID}
...


Joffm
  • greenwoodtree
  • greenwoodtree's Avatar
12 Mar 2024 11:06
Replied by greenwoodtree on topic Create column headers - multiple choice questions
 

File Attachment:

File Name: limesurvey...7977.lss
File Size:33 KB
I have exported the question I am attempting to code within a dummy survey (.lss)
  • greenwoodtree
  • greenwoodtree's Avatar
11 Mar 2024 18:52
Replied by greenwoodtree on topic Create column headers - multiple choice questions
Many apologies! I have forgotten the basics I see. Sorry to waste your time- I do appreciate this is voluntarily given and I have benefitted in the past. (One sometimes gets too stressed and fixated on issues and forgets the basic checks.)
  • Joffm
  • Joffm's Avatar
11 Mar 2024 18:39
As @tpartner,
Or use the big button here
 

I cannot import .lss into a new monolingual survey either

Of course not.
Into a Survey you only can import groups or questions.
You can't import a survey into a survey.
Always remember the naming:
lsq: LimeSurveyQuestion
lsg: LimeSurvyGroup
lss: LimeSurveySurvey
lsa: LimeSurvyArchive

Joffm
  • tpartner
  • tpartner's Avatar
11 Mar 2024 18:25
Replied by tpartner on topic Array with first column text
Here is a version that will toggle the inputs when a radio is clicked or some text is entered:

Code:
<script type="text/javascript" data-author="Tony Partner">  
  $(document).on('ready pjax:scriptcomplete',function(){
 
        // Identify the questions
        var thisQID = {QID};
        var thisQuestion = $('#question'+thisQID);    
        var textQuestion = thisQuestion.nextAll('.multiple-short-txt:eq(0)');
        var textQID = textQuestion.attr('id').replace(/question/, '');
 
        // Hide the text question
        textQuestion.hide();
 
        // Remove all radios from first column
        $('.answer-item:nth-child(2)', thisQuestion).removeClass('radio-item').addClass('text-item');
        $('.answer-item:nth-child(2) :radio', thisQuestion).remove();
 
        // Move the text inputs
        $('tr.answers-list', thisQuestion).each(function(i) {
            var thisCode = $(this).attr('id').split('X'+thisQID)[1];
            $('.answer-item:nth-child(2)', this).append($(':text[id$="X'+textQID+thisCode+'"]', textQuestion));
        });
 
        // Listener on the radios
        $('.radio-item :radio', thisQuestion).on('click', function(e) {
            $(this).closest('tr').find(':text').val('').trigger('keyup');
        });
 
        // Listener on the text inputs
        $('.text-item :text', thisQuestion).on('keyup change', function(e) {
            if($.trim($(this).val()) != '') {
                var thisRadio = $(this).closest('tr').find(':radio:first');
                $(thisRadio).prop('checked', false);
                checkconditions('', $(thisRadio).attr('name'), 'radio');
            }
        });
 
    });
</script>

Sample survey:  

File Attachment:

File Name: limesurvey...5511.lss
File Size:31 KB
  • tpartner
  • tpartner's Avatar
11 Mar 2024 18:00
Replied by tpartner on topic Array with first column text
This'll do the trick:

Code:
<script type="text/javascript" data-author="Tony Partner">  
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify the questions
    var thisQID = {QID};
    var thisQuestion = $('#question'+thisQID);    
    var textQuestion = thisQuestion.nextAll('.multiple-short-txt:eq(0)');
    var textQID = textQuestion.attr('id').replace(/question/, '');
 
    // Hide the text question
    textQuestion.hide();
 
    // Remove all radios from first column
    $('.answer-item:nth-child(2)', thisQuestion).removeClass('radio-item').addClass('text-item');
    $('.answer-item:nth-child(2) :radio', thisQuestion).remove();
 
    // Move the text inputs
    $('tr.answers-list', thisQuestion).each(function(i) {
      var thisCode = $(this).attr('id').split('X'+thisQID)[1];
      $('.answer-item:nth-child(2)', this).append($(':text[id$="X'+textQID+thisCode+'"]', textQuestion));
    });
  });
</script>

 

Sample survey: 

File Attachment:

File Name: limesurvey...8551.lss
File Size:30 KB
  • tpartner
  • tpartner's Avatar
11 Mar 2024 17:51
Please read the manual about exporting a survey - manual.limesurvey.org/Surveys_-_introduction#Export_a_survey
  • greenwoodtree
  • greenwoodtree's Avatar
11 Mar 2024 17:36
Replied by greenwoodtree on topic Create column headers - multiple choice questions
Actually, I cannot import .lss into a new monolingual survey either. I seem to have misunderstood something. Apologies. But how do I export/import lss files when my survey software asks for lsq?
  • greenwoodtree
  • greenwoodtree's Avatar
11 Mar 2024 17:11
Replied by greenwoodtree on topic Create column headers - multiple choice questions
Sorry. My survey is bilingual and I don't seem to be able to export .lss. However, it makes me realise this is why I cannot import an lss question example into my survey. i will try to do that from a dummy monolingual survey and get back to you if I am still having a problem if I may. Thanks for help.
  • Joffm
  • Joffm's Avatar
11 Mar 2024 14:43
Hi,
please, neither provide lsq nor lsg exports.
These are language sensitive and can only be imported into a survey with the same base language.
So only provide lss exports.

Joffm
  • vzyldd
  • vzyldd's Avatar
11 Mar 2024 14:27 - 11 Mar 2024 14:28
Array with first column text was created by vzyldd
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community EditionVersion 5.4.15+221212
Own server or LimeSurvey hosting: Own
Survey theme/template: Fruity
==================
I have found a script (Tony Partner) on the forum to insert a text field in the last column of an array type question. The script is working on my version but I need this text field in the first column. I am not sure how to adapt the script. I've tried changing '.answer-item:last-child' in the script to '.answer-item:first-child' but, due to my limited knowledge, it was a total disaster.

Currently the display is as follows:
  

The script used:<script type="text/javascript" data-author="Tony Partner">
$(document).on('ready pjax:scriptcomplete',function(){
 
// Identify the questions
var thisQID = {QID};
var thisQuestion = $('#question'+thisQID);
var textQuestion = thisQuestion.nextAll('.multiple-short-txt:eq(0)');
var textQID = textQuestion.attr('id').replace(/question/, '');
 
// Hide the text question
textQuestion.hide();
 
// Remove all radios from last column
$('.answer-item:last-child', thisQuestion).removeClass('radio-item').addClass('text-item');
$('.answer-item:last-child :radio', thisQuestion).remove();
 
// Move the text inputs
$('tr.answers-list', thisQuestion). each (function(i) {
var thisCode = $(this).attr('id'). split ('X'+thisQID)[1];
$('.answer-item:last-child', this).append($(':text[id$="X'+textQID+thisCode+'"]', textQuestion));
});
});
</script>
Displaying 196 - 210 out of 761 results.

Lime-years ahead

Online-surveys for every purse and purpose