Welcome, Guest
Username: Password: Remember me

TOPIC: How to insert a number beside the points

How to insert a number beside the points 3 years 4 months ago #59198

  • guislopes
  • guislopes's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Hello folks.
I need to insert a number beside each answer point on the 'array' question type, I already tried limesurvey options but I got nothing more than a headache. Please, someone could help me? I would be very very thankful. :)
The figure explains better what I am trying to.


guislopes_2.png


guislopes_1.png




Thank you!!
Last Edit: 3 years 4 months ago by guislopes. Reason: the picture is not showing up still
The administrator has disabled public write access.

Re: How to insert a number beside the points 3 years 4 months ago #59212

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4138
  • Thank you received: 767
  • Karma: 348
Set up your survey to use JavaScript and place the following script in the source of the array question. Replace "QQ" with the array questtion ID.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		// The array question ID
		var qID = QQ;
 
		// Insert a number beside each radio button
		$('#question'+qID+' table.question tbody').each(function(){
			$('td', this).each(function(i){
				$('<span>'+(i+1)+'</span>').appendTo(this);
			});
		});
 
	});
 
</script>
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: 3 years 4 months ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: guislopes

Re: How to insert a number beside the points 3 years 4 months ago #59218

  • guislopes
  • guislopes's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Hello Tony,

It worked great! THANK YOU VERY MUCH TONY! :laugh:

One more thing, if it is possible, how could I change the font and size of the numbers?
The administrator has disabled public write access.

Re: How to insert a number beside the points 3 years 4 months ago #59220

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4138
  • Thank you received: 767
  • Karma: 348
Something like this at the end of template.css (replace"QQ"):
#questionQQ  table.question tbody span {
	font-size: 1.3em;
	font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
	color: #0000FF;
}
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: 3 years 4 months ago by tpartner.
The administrator has disabled public write access.

Re: How to insert a number beside the points 3 years 4 months ago #59228

  • guislopes
  • guislopes's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Hi Tony,

I did what you said but it did not work. To see if I did it correctly, the following picture is what I did. What may be happened?


guislopes_3.png


Thank you very much for the help!

Guilherme
The administrator has disabled public write access.

Re: How to insert a number beside the points 3 years 4 months ago #59229

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4138
  • Thank you received: 767
  • Karma: 348
That looks okay if the ID is correct. Did you clear your cache?

T.
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.
The following user(s) said Thank You: guislopes

Re: How to insert a number beside the points 3 years 4 months ago #59231

  • guislopes
  • guislopes's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Hi Tony,

You are right. I was a dummy :whistle:
My question is solved.

Thank you very very much! :woohoo:
The administrator has disabled public write access.

Re: How to insert a number beside the points 3 years 4 months ago #59232

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4138
  • Thank you received: 767
  • Karma: 348
:laugh:
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.121 seconds
Donation Image