Welcome, Guest
Username: Password: Remember me

TOPIC: Rich text editor in long text answer

Rich text editor in long text answer 1 year 3 months ago #105015

  • lordzoster
  • lordzoster's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Thank you received: 2
  • Karma: 0
Hallo how could I provider the user with a rich text editor (like TinyMCE) for long text answers?
My aim is that the user can answer entering graphically formatted text (bullets, lists, italic and bold).
Thanks in advance
The administrator has disabled public write access.

Rich text editor in long text answer 1 year 3 months ago #105052

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4871
  • Thank you received: 994
  • Karma: 418
Well, LimeSurvey uses CKEditor but, in my opinion, that is bloated and a pain to set up.

The easiest solution would be to use the CDN version of TinyMCE - www.tinymce.com/index.php.

So, simply adding something like this to startpage.pstpl after the {TEMPLATEJS} tag should do the trick.

<script src="//tinymce.cachefly.net/4.0/tinymce.min.js"></script>
<script>
	tinymce.init({
		plugins: 'link, code',
		menubar : false,
		toolbar1: 'undo redo | formatselect fontselect fontsizeselect | link | code',
		toolbar2: 'bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote', 
		selector:'textarea'
	});
</script>

Capture3_2014-02-14.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.
Last Edit: 1 year 3 months ago by tpartner.
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu, stevelegare, lordzoster

Rich text editor in long text answer 1 year 3 months ago #105059

  • lordzoster
  • lordzoster's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 29
  • Thank you received: 2
  • Karma: 0
Many many many thanks!
The administrator has disabled public write access.

Rich text editor in long text answer 3 months 2 weeks ago #117312

  • marvin06
  • marvin06's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • Karma: 0
Hi

I also wanted to implement this. Basically the WYSIWYG Editor is displayed, but the Long text and Huge text questions only store plain text. So in the print answer page again only plain text is visible.

Do you have a fix for this?

Kind regards
Thomas
The administrator has disabled public write access.

Rich text editor in long text answer 3 months 2 weeks ago #117316

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4871
  • Thank you received: 994
  • Karma: 418
I think that may be a bug in the print-answers function. The data is being stored as HTML.

Capture_2015-02-14.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.

Rich text editor in long text answer 3 months 2 weeks ago #117318

  • marvin06
  • marvin06's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • Karma: 0
Yes you are right. in the export html is exported too. But in the printanswers page the answers are displayed without any html.
This is valid for any template, also for the ready made ones. I suppose that there is an bug in the printanswers control.

I would like to look into the control for the printanswers. Do you know where this is stored?

Kind regards, Thomas
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.180 seconds