Array by column

Mehr
2 Monate 3 Wochen her #180974 von acasadei90CRT
COM_KUNENA_MESSAGE_CREATED_NEW
Hi community,

I'm trying to create an array by column question but I have found two problems:


1) I would like to hide the question if the previous one has not been completed. I can't find the relevance field where I wanted to write --> !is_empty(team01) --> where team01 is the code of the previous question.


2) I have several predefined subquestions. But i would like to show just a number of those equal to the answer of the previous question.
eg. If the answer of the previous question is 3 i would like to see just only 3 rows in the array question.

I have set the following settings (attachment) but it doesn't work.


Thanks in advance for any kind of contribution.


Best Regards


Andrea
Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

LimeSurvey Partners
Mehr
2 Monate 3 Wochen her #180976 von Joffm
COM_KUNENA_MESSAGE_REPLIED_NEW
Hi, Andrea,

please, send a sample file with just these questions.

What is your array by column?
And what type of question is team01? In your subquestion relevance it looks like numerical input.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 3 Wochen her #180978 von acasadei90CRT
COM_KUNENA_MESSAGE_REPLIED_NEW
Goodmorning Joffm,

In the attachment I have tried to add the third question, which has those features that I had already described before.

I would like to hide that question if the respondent hasn't answered the first question yet.

I also would like to reduce the number of columns, based on the first question's answer.

Best Regards,

Andrea
Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 3 Wochen her #180980 von Joffm
COM_KUNENA_MESSAGE_REPLIED_NEW
Hi,

I do not understand why you use an array by column.
In my opinion this is better understandable.


example:

Dateianhang:

Dateiname: limesurvey...7995.lss
Dateigröße:44 KB



And what so you think about this?


example:

Dateianhang:

Dateiname: limesurvey...9321.lss
Dateigröße:26 KB


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 3 Wochen her #180981 von acasadei90CRT
COM_KUNENA_MESSAGE_REPLIED_NEW
Thank you very much for your answer.

The second solution would be perfect (really good-looking form), but I'm not able to make the multiple choice option in the last column.


I will follow your first solution at the moment.


Best Regards

Andrea

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 3 Wochen her #180982 von Joffm
COM_KUNENA_MESSAGE_REPLIED_NEW
Hi,
in the question text - in source code mode - there is:
<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){
		var thisQuestion = $('#question{QID}');
 
		// Insert selects
		$('.answer-item.answer_cell_X004', thisQuestion).addClass('with-select').append('<select class="inserted-select form-control list-question-select">\
													<option value="">Please choose...</option>\
													<option value="1">High school diploma</option>\
													<option value="2">Degree</option>\
													<option value="3">PhD</option>\
													<option value="4">Master</option>\
												</select>'); 
 
		// Listeners
		$('.inserted-select', thisQuestion).on('change', function(i) {
			if($(this).val() != '') {
				$(this).closest('.answer-item').find('input:text').val($.trim($('option:selected', this).text())).trigger('change');
			}
			else {
				$(this).closest('.answer-item').find('input:text').val('').trigger('change');
			}
		});
 
		// Returning to page
		$('.with-select input:text', thisQuestion).each(function(i) {
			var thisCell = $(this).closest('.answer-item');
			var inputText = $.trim($(this).val());
			var selectval = $('select.inserted-select option', thisCell).filter(function () { return $(this).html() == inputText; }).val();
			$('select.inserted-select', thisCell).val(selectval);
		});
 
		// Clean-up styles
		$('select.inserted-select', thisQuestion).css({
			'max-width': '100%'
		});
		$('.with-select input:text', thisQuestion).css({
			'position': 'absolute',
			'left': '-9999em'
		});
	});
</script>

And in "Display / css classes": with-checkbox-array-comments

In this example the x-axis has codes "X001", X002", "X003". "X004"

You have to adapt the script to your needs.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Folgende Benutzer bedankten sich: acasadei90CRT

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 3 Wochen her #180985 von Joffm
COM_KUNENA_MESSAGE_REPLIED_NEW
Hi, another nice option.

Both grids open one row after the other up to the maximum and the name is displayed in the second grid.


Set subquestions and subquestion relevance to:


and the question relevance of the second grid to:
(!is_empty(PartDetail_SQ001_SQ001)) and (!is_empty(PartDetail_SQ001_SQ002)) and (!is_empty(PartDetail_SQ001_SQ003))

example:

Dateianhang:

Dateiname: limesurvey...2-25.lss
Dateigröße:36 KB


Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Anhang:
Folgende Benutzer bedankten sich: acasadei90CRT

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 3 Wochen her #181007 von acasadei90CRT
COM_KUNENA_MESSAGE_REPLIED_NEW
Hi Joffm


Thank you very much for your last message.

I really appreciated your solution. I also have learnt how to use the answers of the previous questions in the following one (your solution for using name and surname instead the general term Participant _ is perfect for my purposes).

I would like to ask you if there is the possibility to create a kind of table that the respondent has to compile but with the possibility to add a new line by himself. I thought to use your last solution where the new line appears when the previous one was fully completed, but in that way i have to set a maximum predefined number of rows and I can't know it in advance.

Best Regards

Andrea

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 3 Wochen her - 2 Monate 3 Wochen her #181024 von Joffm
COM_KUNENA_MESSAGE_REPLIED_NEW
Hi,

yes, you have to define a maximum number.
There are several topics here about the lack of loops in LS. But inventing loops would need a real restructuring of the database.

So, you can do it like this:
Create a grid with a number of subquestions that will not be reached in a real interview. (e,g, 50)
In the subquestion relevance of each row set: "if the row before was filled"

In this case it is not necessary to enter the number of participants before.

Example:

Dateianhang:

Dateiname: limesurvey...7995.lss
Dateigröße:29 KB


Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Anhang:
Last edit: 2 Monate 3 Wochen her by Joffm.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 3 Wochen her #181033 von acasadei90CRT
COM_KUNENA_MESSAGE_REPLIED_NEW
Hi,

I will follow your last suggestion in order to create a similar structure in my survey.

I was looking at the relevance section. I have found very useful your solution about the possibility to hide the question or subquestion if the previous one was empty.

I was wondering if there were the possibility to do the same thing with a one choice question. For example:

Q001. What is your job situation?


a) Student

b) Worker


Now i would like to show a second question if the respondent has chosen the option b)


Is there a way to set the second question's relevance field in order to do it, without using a programming language?


Best Regards,

Andrea

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 3 Wochen her - 2 Monate 3 Wochen her #181036 von Joffm
COM_KUNENA_MESSAGE_REPLIED_NEW
Question relevance means "This question is displayed if the condition is true"

What do you want?

Show the second question, if in Q001 "option b" was selected.

Q001=="Code of option b"


Best regards
Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 Monate 3 Wochen her by Joffm.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha