Welcome to the LimeSurvey Community Forum

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

Multiple question types in array modifiy

More
12 years 1 week ago - 12 years 1 week ago #78609 by barbarian
Replied by barbarian on topic Aw: Re:Multiple question types in array modifiy
Hello!

I want to place one "short text question" and one "array" question (with four radio buttons) side-by-side, like Tpartner explained. But it doesn´t work for me, means it has no effect.
Code:
<script type="text/javascript" charset="utf-8">
 
    $(document).ready(function() {
 
        var qText = 18a;       
        var qArray = 18b;
 
        // Fix the width of the survey
        $( 'table.outerframe' ).css({'width': '900px'});
 
        // Wrap the 2 questions in a container div and style it
        $('#question'+qText+', #question'+qArray+'').wrapAll('<div class="inlineWrapper" />');
        $('.inlineWrapper').append('<div style="clear:both" />');
        $('.inlineWrapper').css({
            'width': '75%',
            'margin':'0 auto 10px auto',
            'background-color':'#FFFFFF'
        });
        $('.inlineWrapper *').css({
            'padding': '0',
            'margin':'0'
        });
 
        // Hide the question and the help text
        $('#question'+qText+' td.questiontext, #question'+qArray+' td.questiontext').parent().hide();
        $('#question'+qText+' > table:eq(1), #question'+qArray+' > table:eq(1)').hide();
        $('#question'+qText+' td.survey-question-help, #question'+qArray+' td.survey-question-help').parent().hide();
 
        //Hide the answer cell of the array
        $('#question'+qArray+' table.question thead tr').children(":first").hide();
        $('#question'+qArray+' table.question tbody tr').children(":first").hide();
        $('#question'+qArray+' col').attr('width', '');
 
        // Push all question tables to 100%
        $('#question'+qText+' table, #question'+qArray+' table').css({'width': '100%'});
 
        // Get the 2 questions to sit politely side by side
        $('#question'+qText+', #question'+qArray+'').css({'float':'left'});
        $('#question'+qText+'').css({'padding':'15px 0 5px 25px'});
        $('#question'+qText+'').css({'padding-top':'27px'}); // Adjust here for wrapped array labels
        $('#question'+qArray+'').css({'padding':'5px 0 10px 0'});
        $('#question'+qArray+' table.question td').css({'padding':'4px'});
        $('#question'+qText+' table:first').attr('align', 'left');
        $('#question'+qText+' label').css({
            'display':'inline', 
            'width':'auto', 
            'margin-right':'10px'
        });
 
        // Set the widths of the 2 questions
        $('#question'+qText+'').css({'width': '35%'});
        $('#question'+qArray+'').css({'width': '58%'});
 
    });
 
</script>
Maybe someone can help me please.
Using 1.92+
Last edit: 12 years 1 week ago by barbarian.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
12 years 1 week ago #78614 by Mazi
Please tell us which template you are using and post a link to a sample survey.

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.
More
12 years 1 week ago #78628 by barbarian
Hey!

test-survey
test
key:test

It´s the default-Template, language is german

The questions 18 and 19 shall be side-by-side

Thanks for your answer:-)
The topic has been locked.
More
12 years 1 week ago #78709 by barbarian
or, if it´s easier, I could use Dual Array.
But then I need on the left column a Drop Down BUT on the right Radio Buttons.
(as a result I would have two questions in one question type)
The topic has been locked.
More
11 years 11 months ago #80285 by AlexiaK
Replied by AlexiaK on topic Multiple question types in array modifiy
Hi all,

In my survey I will be needing something similar to what the multiple question types in an array can offer (I will need text, yes/no, then two dropdown lists). And so I decided to try the code that was provided ( docs.limesurvey.org/tiki-index.php?page_...stion_types_in_array ), but the result looks like what someone posted previously. And I really don't know what I'm doing that's wrong as I've just copied and pasted the code. I'm using the default template and I have the 1.92+.


Thank you in advance for your help!
Attachments:
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 11 months ago #80305 by tpartner
Replied by tpartner on topic Multiple question types in array modifiy
Can you activate a sample survey?

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
11 years 11 months ago #80310 by AlexiaK
Replied by AlexiaK on topic Multiple question types in array modifiy
I just started a new test survey, tried it again and it worked perfectly! But after exporting the question group and adding it to my main survey.. the only thing that appears is the 0-100% bar at the top of the page. My main survey isn't live yet so I've attached the questions group file. Is there anything else I should attach?

File Attachment:

File Name: limesurvey...p_72.lsg
File Size:76 KB
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
11 years 11 months ago #80314 by Mazi
Replied by Mazi on topic Multiple question types in array modifiy
Did you adapt the IDs (the group ID will change) at this workaround?

Can you post a link to an activated sample survey?

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.
More
11 years 11 months ago #80330 by AlexiaK
Replied by AlexiaK on topic Multiple question types in array modifiy
I deleted some of the question groups I won't be using and it now works! I have no idea how.. How do you adapt the IDs (possibly I deleted a question group with similar IDs?).

So now that this is working, I need to adapt it.. How do I change the code in the Multiple question types in array: text, yes/no, short text, numeric, dropdown list

into:

text, yes/no and two dropdown lists?
The topic has been locked.
More
11 years 8 months ago #84631 by mjr244
Replied by mjr244 on topic Multiple question types in array modifiy
Hi!

After spending many hours on this, I'm posting for help! I'm trying to incorporate multiple arrays and "normal" (non-inline) questions in the same survey. I was successful in getting my first array to work, using the original workaround . But I can't seem to make a second array work, no matter how I tweak the start question parameters.

To clarify, I'm trying to do something like this:
normal (non-inline) questions, then multiple question types in an array, then another array of multiple question types, then more normal questions.

I'm partway through implementing the "XHTML more valid" workaround--but, at the risk of seeming lazy, I wanted to check first, because I've already been sinking so many hours into this. :pinch:

Thanks in advance for any help you can provide! I've already benefited a great deal from the workaround and subsequent modifications, even if I haven't gotten multiple arrays to play well together yet.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
11 years 8 months ago #84639 by Mazi
Replied by Mazi on topic Multiple question types in array modifiy
Please post a link to an activated test survey so we can check if there is anything wrong at your code.

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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 8 months ago #84646 by tpartner
Replied by tpartner on topic Multiple question types in array modifiy
The workaround was never intended to be used more than once on a page and would require extensive alteration to do so. I recommend putting your questions on two pages.

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