Rich text editor in long text answer

More
3 years 9 months ago #105015 by lordzoster
lordzoster created the topic: Rich text editor in long text answer
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

Please Log in to join the conversation.

More
3 years 9 months ago - 3 years 9 months ago #105052 by tpartner
tpartner replied the topic: Rich text editor in long text answer
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>



.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 3 years 9 months ago by tpartner.
The following user(s) said Thank You: DenisChenu, stevelegare, lordzoster

Please Log in to join the conversation.

More
3 years 9 months ago #105059 by lordzoster
lordzoster replied the topic: Rich text editor in long text answer
Many many many thanks!

Please Log in to join the conversation.

More
2 years 9 months ago #117312 by marvin06
marvin06 replied the topic: Rich text editor in long text answer
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

Please Log in to join the conversation.

More
2 years 9 months ago #117316 by tpartner
tpartner replied the topic: Rich text editor in long text answer
I think that may be a bug in the print-answers function. The data is being stored as HTML.


Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:

Please Log in to join the conversation.

More
2 years 9 months ago #117318 by marvin06
marvin06 replied the topic: Rich text editor in long text answer
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

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!