Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi
  • Page :
  • 1

SUJET : how to make two question type in one wrap using limesurvey

how to make two question type in one wrap using limesurvey il y a 6 mois 2 semaines #89296

  • mimi
  • Portrait de mimi
  • Hors ligne
  • Junior Lime
  • Messages : 28
  • Karma: 0
hi..

i want to put two question type in one question.
but when i did, it'll be separated.
i want to make it in one wrapped and the second answer is on the right side
here i attach the example of question that i've done
Pièces jointes :
Dernière édition: il y a 6 mois 2 semaines par mimi.
L'administrateur à désactivé l'accès en écriture pour le public.

Aw: how to make two question type in one wrap using limesurvey il y a 6 mois 2 semaines #89300

  • jelo
  • Portrait de jelo
  • Hors ligne
  • Platinum Lime
  • Messages : 345
  • Remerciements reçus 32
  • Karma: 13
There is no free format question type to mix questions together out of the box.

Perhaps our javascript wizards can provide you a workaround with javascript/css to display these two question side by side.
L'administrateur à désactivé l'accès en écriture pour le public.

Re: Aw: how to make two question type in one wrap using limesurvey il y a 6 mois 2 semaines #89315

  • DenisChenu
  • Portrait de DenisChenu
  • Hors ligne
  • Moderator Lime
  • Messages : 4513
  • Remerciements reçus 471
  • Karma: 168
Hello,
It's only a css problem, tou can do that in template.css too.

A javascript quick workaround.
Seem you using default template
After reading the javascript workaround section of the wiki.
In the first question
$(function() {
 $("question{QID} .question-wrapper").parent('tr').css('margin-bottom','0');
});

In the second question:
$(function() {
$("#question{QID} .questiontext").parent('tr').hide();
});
L'administrateur à désactivé l'accès en écriture pour le public.

Re: Aw: how to make two question type in one wrap using limesurvey il y a 6 mois 2 semaines #89328

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 2937
  • Remerciements reçus 446
  • Karma: 253
Or to expand on Denis's train of thought :P

Add this to the first question. It will hide the second question and move its radios to the answer element of the first.
<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
 
		// Identify the questions
		var thisQuestion = $('#question{QID}');
		var nextQuestion = $(thisQuestion).next('div[id^="question"]');
 
		// Hide the next question
		$(nextQuestion).hide();
 
		// Move the radios from the next question
		$('.answer .answer-item', thisQuestion).append($('ul.answers-list', nextQuestion));
 
		// Some cleanup styles
		$('.answer-item select, .answer-item ul, .answer-item li', thisQuestion).css({
			'float': 'left'
		});
		$('.answer-item ul', thisQuestion).css({
			'list-style': 'none',
			'margin-left': '50px'
		});
		$('.answer-item li', thisQuestion).css({
			'margin-right': '15px'
		});
	});
</script>

capture.jpg
Cheers,
Tony

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
L'administrateur à désactivé l'accès en écriture pour le public.

Re: Aw: how to make two question type in one wrap using limesurvey il y a 6 mois 2 semaines #89376

  • mimi
  • Portrait de mimi
  • Hors ligne
  • Junior Lime
  • Messages : 28
  • Karma: 0
tQ s0 much to all of u for helping.

:lol:
it works! :)
L'administrateur à désactivé l'accès en écriture pour le public.

Re: Aw: how to make two question type in one wrap using limesurvey il y a 4 mois 1 semaine #92491

  • Serafim
  • Portrait de Serafim
  • Hors ligne
  • Expert Lime
  • Messages : 86
  • Karma: 1
Hi there, is it possible repeat the code? So I would have more than one drop list and more than one second question?
L'administrateur à désactivé l'accès en écriture pour le public.

Re: Aw: how to make two question type in one wrap using limesurvey il y a 4 mois 6 jours #92537

  • tpartner
  • Portrait de tpartner
  • Hors ligne
  • LimeSurvey Team
  • Messages : 2937
  • Remerciements reçus 446
  • Karma: 253
You can repeat this code as many times on a page as you like. It will manipulate any drop-down question it is inserted in (and the following radio question).
Cheers,
Tony

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
L'administrateur à désactivé l'accès en écriture pour le public.
  • Page :
  • 1
Modérateurs: DenisChenu, ITEd
Temps de génération de la page : 0.271 secondes
Donation Image