Array question with answers in dropdown boxes

Mehr
2 Jahre 3 Monate her #137953 von DenisChenu
DenisChenu antwortete auf das Thema: Array question with answers in dropdown boxes

Juanoche schrieb:

DenisChenu schrieb: Hi,

Actually for such solution : you have a plugin : www.limesurvey.org/forum/plugins/104019-...ith-dropdwon-or-mask

It work on a 2.50 last time i tested.


DenisChenu I had already seen that plugin but unfortunately I get a 500 error on my server when I install it and try to acces survey settings / Plugins

See github.com/SondagesPro/LS-arrayTextAdapt...suecomment-223626556

I can not reproduce the issue : then need tester.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Jahr 11 Monate her #143401 von ramzus
ramzus antwortete auf das Thema: Array question with answers in dropdown boxes
Hi tpartner,

I used this solution and it was very helpful, but now i want to show the selected dropdown text in the next question but the Limesurvey replacement field properties shown only the code selected.

Thanks

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Jahr 11 Monate her #143406 von tpartner
tpartner antwortete auf das Thema: Array question with answers in dropdown boxes
Err...which solution. There are many in this thread, some of which are years old. It may be better to start a new thread describing exactly what you did and the details of your LimeSurvey environment.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Jahr 11 Monate her #143413 von ramzus
ramzus antwortete auf das Thema: Array question with answers in dropdown boxes
The solution for the array question with text answers in a dropdown box i want to show the selected dropdown text in the next question but the Limesurvey replacement field properties shown only the code selected.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
        $('#questionQQ .answer_cell_001 option[value=1]').text('No recurro');
        $('#questionQQ .answer_cell_001 option[value=2]').text('Arocena Gustavo');
        $('#questionQQ .answer_cell_001 option[value=3]').text('Aspra Manuel');
        $('#questionQQ .answer_cell_001 option[value=4]').text('Bravo Ricardo');
        $('#questionQQ .answer_cell_001 option[value=5]').text('Zalazar Martin');
 
        $('#questionQQ .answer_cell_002 option[value=1]').text('No recurro');
        $('#questionQQ .answer_cell_002 option[value=2]').text('Bravo Ricardo');
        $('#questionQQ .answer_cell_002 option[value=3]').text('Fernandez Flavio');
        $('#questionQQ .answer_cell_002 option[value=4]').text('Zalazar Martin');
        $('#questionQQ .answer_cell_002 option[value=5]').text('').hide();
 
    });

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Jahr 11 Monate her #143424 von tpartner
tpartner antwortete auf das Thema: Array question with answers in dropdown boxes
In that case, you would either need to use Expression Manager to pipe in the text depending on the code or use Denis' arrayTextAdapt plugin .

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
1 Jahr 11 Monate her #143436 von ramzus
ramzus antwortete auf das Thema: Array question with answers in dropdown boxes
Thank you very much, i will try this

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Monate 4 Tage her #170145 von b1994mi
b1994mi antwortete auf das Thema: Array question with answers in dropdown boxes
Hi,

I have been using tpartner's javascript for providing dropdown options on array (texts). But, now I need something a bit specific. I need to make certain row readonly and force an answer that is different from the options provided by the dropdown.

What the respondents will think is that this readonly inputs are fixed because they need to use MRT for that journey.

Here is the mockup of what I need:
Warnung: Spoiler! [ Zum Anzeigen klicken ]


I have attached my survey file with only the corresponding question group.
Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Monate 3 Tage her #170227 von tpartner
tpartner antwortete auf das Thema: Array question with answers in dropdown boxes
I don't think it's possible with a single array question as your "MRT" row is a moving target depending on the answers to the first two questions. I would do it with three array questions, styled with CSS to appear as one.

- One array for modes getting to MRT
- One (readonly) array for MRT
- One array for modes getting from MRT

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Monate 3 Tage her #170232 von b1994mi
b1994mi antwortete auf das Thema: Array question with answers in dropdown boxes
Hi,

I have found this thread and it is about two radio button question merged into one.

How to call the previous question? (assuming that I place the MRT in the middle)

Or is there any exact thread you can refer? It is a bit too complicated for me to implement the CSS :(

Thank you in advance.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Monate 3 Tage her #170236 von tpartner
tpartner antwortete auf das Thema: Array question with answers in dropdown boxes
It would be far easier to do it with CSS but the details would depend on your LimeSurvey version and theme.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Monate 2 Tage her #170276 von b1994mi
b1994mi antwortete auf das Thema: Array question with answers in dropdown boxes
Hi,

My Limesurvey version is Version 3.6.2+180406 and the theme is fruity. Is there any thing that I should notice if I ever needed the workaround to be done on another version and theme?

Thank you in advance.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
3 Monate 2 Tage her #170278 von tpartner
tpartner antwortete auf das Thema: Array question with answers in dropdown boxes
- Assign Q1 a CSS class "merge-bottom".
- Assign Q2 CSS classes "merge-top merge-bottom".
- Assign Q3 a CSS class "merge-top".

Add something like this to custom.css in your extended theme:

.question-container.merge-bottom {
    margin-bottom: 0;
    border-bottom: 0 none;
}
 
.question-container.merge-bottom .answer-container {
    padding-bottom: 0;
}
 
.question-container.merge-top,
.question-container.merge-top .subquestion-list,
.question-container.merge-top .subquestion-list tbody tr:first-child > * {
    border-top: 0 none;
}
 
.question-container.merge-top .answer-container {
    padding-top: 0;
}
 
.question-container.merge-top .question-title-container,
.question-container.merge-top .question-valid-container,
.question-container.merge-top .subquestion-list thead {
	display: none;
}



Regarding other themes - you would need to explore the HTML and CSS affecting the layout to determine what is required.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 4 Wochen her #170411 von b1994mi
b1994mi antwortete auf das Thema: Array question with answers in dropdown boxes
Hi,

Thank you, it worked. But, a new problem arises. I need to force input the array fields. :(

So far I have used:
{middle_1_SQ001="MRT"}
{middle_1_SQ002=20}
{middle_1_SQ003=8000}
to force input, but it did not work. How is so?

Here is what it looks like:
Warnung: Spoiler! [ Zum Anzeigen klicken ]


I have attached my survey file below.

Btw, I need to use 'for loop' to calculate time from one station to another and input in 'time (min)' for MRT. Should I just make a new thread or is there already a thread that asks the same question?
Anhang:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 4 Wochen her #170432 von tpartner
tpartner antwortete auf das Thema: Array question with answers in dropdown boxes
If you want to use Expression Manager to set answers, you must place those statements in equation type questions positioned after the array.

Having said that, you could use JavaScript to set the answers as you render the inputs readonly.

<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){
		$("#answer{SGQ}1_SQ001").val('MRT').trigger('keyup').prop("readonly",true);
		$("#answer{SGQ}1_SQ002").val(20).trigger('keyup').prop("readonly",true);
		$("#answer{SGQ}1_SQ003").val(8000).trigger('keyup').prop("readonly",true);
	});
</script>


Regarding your 'for loop' question - sorry, I have no idea what you are trying to do.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Monate 4 Wochen her #170438 von b1994mi
b1994mi antwortete auf das Thema: Array question with answers in dropdown boxes
I see, I think this would be all that I need. I don't think the for loop is necessary anymore, so let's just forget it.

Thank you very much for your help. :)

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