Welcome, Guest
Username: Password: Remember me

TOPIC: align answer

align answer 2 years 6 months ago #67063

  • nico_8it
  • nico_8it's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
Hi everyone,
how can I align answers in multiple numerical input type question?
as in the answers the last question on page 1:


cna.odip-cer.net/index.php?sid=81361&newtest=Y&lang=it
The administrator has disabled public write access.

Re: align answer 2 years 6 months ago #67073

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
1. Which Limesurvey version do you use?

2. The template you are using seems to be heavily modified. Usually each question type has it's own class which can be used to style question types or parts of it by editing the template.css file.
Have a look at docs.limesurvey.org/The+template+editor&...g_questions_with_CSS

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: align answer 2 years 6 months ago #67089

  • nico_8it
  • nico_8it's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
Hi,
I attached the txt

File Attachment:

File Name: template.txt
File Size: 15 KB

template file.
where do you think creates the misalignment?
The administrator has disabled public write access.

Re: align answer 2 years 6 months ago #67092

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 3814
  • Thank you received: 683
  • Karma: 328
Can you please give us a screenshot of the "misalignment" and how you would like it to look?
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.
The administrator has disabled public write access.

Re: align answer 2 years 6 months ago #67097

  • nico_8it
  • nico_8it's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
I attached the file "misaligned" and how I see it (alignment.jpg)
misalignment.jpg


alignment.jpg
The administrator has disabled public write access.

Re: align answer 2 years 6 months ago #67102

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 3814
  • Thank you received: 683
  • Karma: 328
Mazi is correct, your questions are not wrapped in an element with the question ID and the question type class.

You need something like this in question.pstpl:
<div {QUESTION_ESSENTIALS} class="{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}">
	<!-- Your question.pstpl contents here -->
</div>
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.
Last Edit: 2 years 6 months ago by tpartner.
The administrator has disabled public write access.

Re: align answer 2 years 6 months ago #67154

  • nico_8it
  • nico_8it's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
My question.pstpl is differt, so

I changed into template.css answertext align = right aligned
and automatically the boxes of the answers aligns to the right, but doing so also the text.
I want it to do so only for the boxes of multiple numeric input, and multiple choice with comments questions...
The administrator has disabled public write access.

Re: align answer 2 years 6 months ago #67158

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 3814
  • Thank you received: 683
  • Karma: 328
You will not be able to do this without the proper code in question.pstpl. There is no way to differentiate the question types.

I recomend you modify your template to include the question wrapper code.
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.
The administrator has disabled public write access.

Re: align answer 2 years 6 months ago #67162

  • nico_8it
  • nico_8it's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 24
  • Thank you received: 1
  • Karma: 1
Mh,
this is my question.psptl

File Attachment:

File Name: question.txt
File Size: 1 KB
The administrator has disabled public write access.

Re: align answer 2 years 6 months ago #67167

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 3814
  • Thank you received: 683
  • Karma: 328
That's pretty close to the default template.

Try this:
<div {QUESTION_ESSENTIALS} class="{QUESTION_CLASS}{QUESTION_MAN_CLASS}{QUESTION_INPUT_ERROR_CLASS}">
	<table class="question-wrapper">
		<tr>
						<td class="questiontext">
							<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}
						</td>
					</tr>
					<tr>
						<td class="answer">
							{ANSWER}
						</td>
					</tr>
					<tr>
						<td class="survey-question-help">
							{QUESTIONHELP}
						</td>
					</tr>
				</table>
</div>

Note that there is a new class for the "survey-question-help" element so you may need to tweak the stylesheet to accomodate that:

Capture_2011-10-12.PNG
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.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.134 seconds
Donation Image