setup Multiple question types in array

More
8 months 3 weeks ago - 8 months 3 weeks ago #147879 by ledermueller
ledermueller created the topic: setup Multiple question types in array
Hi folks!
First: i am a total beginner with JavaScript/Jquery and i have no ides wich version of LimeSurvey i am using (i have to ask our admin on monday)
Here my wish: I want to create a arrax with miltiple answere types. there should be 3 rows (croprot1, croprot2, croprot3) and 4 colums. the first two colums as drop down (crop1, crop2) and the second two colums as multiple choice/checkbox (technic1, technic2).
I setup the servey with a group "Croprotation" and the subquestions "crop1" (as drop down), "crop2" (as drop down). it should look like this in the attached

File Attachment:

File Name: Croprotation.csv
File Size:0 KB


I found the manual with the code for something like this ( manual.limesurvey.org/Workarounds:_Quest...stion_types_in_array ), the problem is, i have no idea where to maupulate to get it working. At least i could load the file into my survey, i put is into the questiongroup.
It would be sooooo great if anybody could give me a hint how to change the code for my case.
Thanks in advance,
chears,
Sandra
Attachments:
Last Edit: 8 months 3 weeks ago by ledermueller.

Please Log in to join the conversation.

More
8 months 3 weeks ago #147883 by holch
holch replied the topic: setup Multiple question types in array
The version of your Limesurvey installation can usually be found at the bottom of each admin page and usually says something like Limesurvey 2.xx 170112 or something.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
8 months 3 weeks ago #147889 by ledermueller
ledermueller replied the topic: setup Multiple question types in array
Hi, found it! it's Version 2.56.1+161118

Please Log in to join the conversation.

More
8 months 3 weeks ago #147891 by ledermueller
ledermueller replied the topic: setup Multiple question types in array
to specifie my questions i marked my ideas/suggestions in red:
<script type="text/javascript" charset="utf-8">

$(document).ready(function() {
// Call the "sideBySide" function with number of rows, columns and start position
sideBySide(4, 5, 3); --> 3 for rows, 4 for colums, 1 to star with the first question in the group
});

function sideBySide(rows, columns, startQuestion) {

/*********** Display multiple questions side by side ***********/

if ($('div.qRow1').length == 0) {

var rowNum = 0;
var colNum = 1;
var rowList = new Array();

//////// Add question classes for later use ////////

// Loop through all questions and add row and column specific classes
$('div[id^="question"]').each(function(i) { --> question= Croprotatios (like the groupname)
if(i >= (startQuestion-1) && rowNum < rows) { // This IF condition only needed if there are questions before or following the "inline" questions
$(this).addClass('qRow'+rowNum+'').addClass('qCol'+colNum+'').addClass('inlineQuestion'); --> 'qRow'=1, 'qCol'=1 for the first question, what about 'inlineQuestion'?
--> then i do this for all questions (croprot2 and 3. i don't need if clauses

if(rowNum == 0 && colNum > 1) {
$(this).addClass('columnLabel');
}
if(rowNum > 0 && colNum == 1) {
$(this).addClass('rowLabel');
}
else if(rowNum > 0 && colNum > 1) {
$(this).addClass('questionCell');
}
if(colNum == columns) {
rowList.push('qRow'+rowNum+'');
rowNum++;
colNum = 1;
}
else {
colNum++;
}
}
else {
$(this).addClass('normalQuestion');
}
});

//////// Survey layout manipulation ////////

// Fix the width of the survey
$('table.outerframe').css({
'width': '900px'
});

// Wrap each "row" in a wrapper div
$(rowList).each(function(i) {
$('.'+this+'').wrapAll('<div id="inlineWrapper'+i+'" class="inlineRow" />'); -->
});

// Style the wrapper divs
$('.inlineRow').css({
'width': '850px',
'margin': '0 auto 0 auto',
'clear': 'both'
});

$( '.inlineRow:first' ).css({ --> here i put croprot1??? as the first row to appear?
'margin-top': '10px'
});

// Get all the questions to sit politely side by side
$( '.inlineQuestion' ).css({
'float': 'left',
'height':'41px',
'overflow':'hidden',
'margin-bottom': '-8px'
});
$( '.inlineQuestion .questionhelp' ).hide();
$( '.inlineQuestion .survey-question-help' ).parent().hide();

// A little space under the last row
$( '.inlineRow:last .inlineQuestion' ).css({
'margin-bottom': '10px'
});

// Any questions not displayed inline (this is only needed if there are questions following the "inline" questions)
$( '.normalQuestion' ).css({
'clear': 'both'
});

//////// Column manipulation ////////

puh thats a jungle for me, but if you give me a hint i could figuere out the rest by myselve, hopefully ;-)

Please Log in to join the conversation.

More
8 months 3 weeks ago #147915 by ledermueller
ledermueller replied the topic: setup Multiple question types in array
solved!!! my admin helped me and with the modified script for version 2.5.8 it's working
www.limesurvey.org/forum/can-i-do-this-w...west-template#146638
byebye

Please Log in to join the conversation.

More
6 months 3 days ago #152642 by ledoux
ledoux replied the topic: setup Multiple question types in array
I folks
I would like an array (multiple items) and for each item, the respondent can fill multiple answers (in column). This type of question does exist without coding?
thank you !!

New user of LS but with the will to contribute to this great community !

Please Log in to join the conversation.

More
6 months 3 days ago #152643 by holch
holch replied the topic: setup Multiple question types in array
Something like this?
manual.limesurvey.org/Question_types#Array_.28Numbers.29
The option with check boxes?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
The following user(s) said Thank You: ledoux

Please Log in to join the conversation.

More
5 months 4 weeks ago #153104 by ledoux
ledoux replied the topic: setup Multiple question types in array
Yes exactly Holch !
I read the manual, but I couldn't set up the options to obtain what is displayed as an example. I obtained only one column (I set "0 to 1, step 1", I also tried 0 to 3). I don't know how to create several columns, and assign a label to each column.
could you help me on that ?
thank you very much

New user of LS but with the will to contribute to this great community !

Please Log in to join the conversation.

More
5 months 4 weeks ago #153199 by holch
holch replied the topic: setup Multiple question types in array
You need to define subquestions (Vertical items to the left) AND answer options / labels (horizontal items on the top).

manual.limesurvey.org/Question_type_-_Array_(Numbers)
If you go there, there is even an example question that you can download.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
The following user(s) said Thank You: ledoux

Please Log in to join the conversation.

More
5 months 3 weeks ago #153268 by ledoux
ledoux replied the topic: setup Multiple question types in array
Thank you Holch, I've been on this page of the manual, but it doesn't say clearly how to add collumns (labels - horizontal items at the top). Or I haven't understand..
where do I "define subquestions (Vertical items to the left) AND answer options / labels (horizontal items on the top)." ?
thanl you very much...

New user of LS but with the will to contribute to this great community !

Please Log in to join the conversation.

More
5 months 1 week ago #154642 by ledoux
ledoux replied the topic: setup Multiple question types in array
Dear Holch
I can add "subquestions" (horizontal) but the option to add "columns" (to be checked) is not proposed (there is only one for the moment, like a classical "array with 1 checkbox".
What is the process to allow me to propose multiple columns ?

In the manual, the question to be download is in format CSV... If I change the extension and put lsq. then when I import it it says "This is not a valid LimeSurvey question structure XML file.".

I'm quite blocked...

thank you !!

New user of LS but with the will to contribute to this great community !

Please Log in to join the conversation.

More
5 months 1 week ago #154643 by holch
holch replied the topic: setup Multiple question types in array
I am not quite sure where you are stuck at the moment. Because it definitely works the way I am describing it. Can you show a screenshot that shows where the problem is located or where you can't move forward and what question type you are working with?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
The following user(s) said Thank You: ledoux

Please Log in to join the conversation.

More
5 months 1 week ago #154694 by LouisGac
LouisGac replied the topic: setup Multiple question types in array
I would like to say that such a design (multiple question types in an array) can not be used on small screens.

Smartphones represent more than 50% of users today. IMHO: You'd rather stop using arrays in your survey design.
The following user(s) said Thank You: ledoux

Please Log in to join the conversation.

More
5 months 1 week ago #154765 by ledoux
ledoux replied the topic: setup Multiple question types in array
hi, not easy to do without arrays. It is an important part of survey methodology...
thanks for the advise though !

New user of LS but with the will to contribute to this great community !

Please Log in to join the conversation.

More
5 months 1 week ago #154766 by ledoux
ledoux replied the topic: setup Multiple question types in array
Holch,
it is ok, the options to create columns ("answer options") are at the very bottom of the page "set subquestions", after having set the items (subquestions).
Usually "subquestions options" and "answers options" are not in the same page. so I was not looking so down in the page...
thanks again !

New user of LS but with the will to contribute to this great community !

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now