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

SUJET : Put the answer and question at the same line

Put the answer and question at the same line il y a 1 an 2 mois #97220

  • boyan
  • Portrait de boyan
  • Hors ligne
  • Senior Lime
  • Messages : 49
  • Remerciements reçus 9
  • Karma: 1
Dear all,

For questions such as Name, I'd like to put the "short free text" answer box at the same line as the question. The purpose is to make the survey look shorter. I have played with the template with on luck. Any suggestions? Thanks!
L'administrateur a désactivé l'accès en écriture pour le public.

Put the answer and question at the same line il y a 1 an 2 mois #97246

  • actxcellence
  • Portrait de actxcellence
  • Hors ligne
  • Junior Lime
  • Messages : 37
  • Remerciements reçus 7
  • Karma: 0
If you ask more than one short text, try multi short text.

If you want answers with questions in one row, edit the template file question.pstlp

To get this:

La pièce jointe name_same_row.png est absente ou indisponible



remove two lines from the default template:

La pièce jointe name_same_row_edit.png est absente ou indisponible



but this will change all appearence of question and answer.

look here for changes on a single question:
manual.limesurvey.org/Workarounds:_Quest..._.22question_code.22
Schon die Bedienungsanleitung von LimeSurvey angeschaut?
Bedienungsanleitung (DE) | Tricks, um mehr Antworten auf Fragen im Forum zu erhalten
L'administrateur a désactivé l'accès en écriture pour le public.

Put the answer and question at the same line il y a 1 an 2 mois #97247

  • boyan
  • Portrait de boyan
  • Hors ligne
  • Senior Lime
  • Messages : 49
  • Remerciements reçus 9
  • Karma: 1
In the template I am dealing with, <div> is used. I could use div {display: inline;} to make it happen. But as you said, that will mess up the whole layout. I guess this is no easy work-around at this time. Thank you!
L'administrateur a désactivé l'accès en écriture pour le public.

Put the answer and question at the same line il y a 1 an 2 mois #97265

  • tpartner
  • Portrait de tpartner
  • En ligne
  • LimeSurvey Team
  • Messages : 4134
  • Remerciements reçus 765
  • Karma: 347
If your template uses <div> elements, you should be able to use JavaScript to wrap the question and answer divs in a new div and then display them inline. The script would only affect the parent question.

Can you attach an export of your template or activate a test survey?
Cheers,
Tony Partner

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

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

Put the answer and question at the same line il y a 1 an 2 mois #97278

  • boyan
  • Portrait de boyan
  • Hors ligne
  • Senior Lime
  • Messages : 49
  • Remerciements reçus 9
  • Karma: 1
Below is the code from question.pstpl. My understanding is that it applies to all questions.

<div {QUESTION_ESSENTIALS} class="{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}">
<div class="survey-question">
<div class="survey-question-text">
<!-- {QUESTION_CODE}: --><span class="asterisk">{QUESTION_MANDATORY}</span><span class="qnumcode">{QUESTION_NUMBER} {QUESTION_CODE}. </span>{QUESTION_TEXT}<br />
<span class="questionhelp">{QUESTION_HELP}</span>
{QUESTION_MAN_MESSAGE}
{QUESTION_VALID_MESSAGE}
{QUESTION_FILE_VALID_MESSAGE}
</div>
<div class="survey-question-answer">{ANSWER}</div>

</div>
<div class="survey-question-space"></div>
</div>
L'administrateur a désactivé l'accès en écriture pour le public.

Put the answer and question at the same line il y a 1 an 2 mois #97279

  • tpartner
  • Portrait de tpartner
  • En ligne
  • LimeSurvey Team
  • Messages : 4134
  • Remerciements reçus 765
  • Karma: 347
Can you attach an export of your template or activate a test survey?
Cheers,
Tony Partner

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

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

Put the answer and question at the same line il y a 1 an 2 mois #97280

  • boyan
  • Portrait de boyan
  • Hors ligne
  • Senior Lime
  • Messages : 49
  • Remerciements reçus 9
  • Karma: 1
Here it is.
Pièces jointes :
L'administrateur a désactivé l'accès en écriture pour le public.

Put the answer and question at the same line il y a 1 an 2 mois #97281

  • tpartner
  • Portrait de tpartner
  • En ligne
  • LimeSurvey Team
  • Messages : 4134
  • Remerciements reçus 765
  • Karma: 347
Oh, that's even easier than I thought. The question and answer divs already have a wrapper div.

Set up your survey to use JavaScript and add this to the question source. This script will apply a new "inlineAnswer" class to the question.
<script type="text/javascript" charset="utf-8">	
	$(document).ready(function(){
		$('#question{QID}').addClass('inlineAnswer');
	});
</script>


Then you can add something like this to the end of template.css:
/** Inline answer questions **/
 
.inlineAnswer .survey-question-text,
.inlineAnswer .survey-question-answer {
	float: left;
}

La pièce jointe Capture_2013-06-22.JPG est absente ou indisponible



I think you can also remove the <br /> tag in question.pstpl to get rid of some of the whitespace under the question. The following spans are set to display block so should end up on new lines anyway.

La pièce jointe Capture2_2013-06-22.JPG est absente ou indisponible

Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Dernière édition: il y a 1 an 2 mois par tpartner.
L'administrateur a désactivé l'accès en écriture pour le public.

Put the answer and question at the same line il y a 1 an 2 mois #97283

  • boyan
  • Portrait de boyan
  • Hors ligne
  • Senior Lime
  • Messages : 49
  • Remerciements reçus 9
  • Karma: 1
It is not working in my case. I tried IE, Firebox, Chrome, and Opera. I tried adding display: inline; right after float: left; in the template.css and that did not help either.

I activated the survey at survey.bluevalleyk12.org/index.php?sid=28238&lang=en so that you can take a look. Thank you very much for your help!
L'administrateur a désactivé l'accès en écriture pour le public.

Put the answer and question at the same line il y a 1 an 2 mois #97284

  • tpartner
  • Portrait de tpartner
  • En ligne
  • LimeSurvey Team
  • Messages : 4134
  • Remerciements reçus 765
  • Karma: 347
What version of LimeSurvey?
Cheers,
Tony Partner

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

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