Can't keep the Indentation code after saving...

Can't keep the Indentation code after saving...

by Miki Alliel -
Number of replies: 8
Picture of Translators
Hello all of you,
I really Hope there is a solution to this kind of critical problem that I found.
we give our students the assignment "online text" which they submit a code as an answer. the code has Indentation and it's very important to keep it, so the teacher can edit the submission and correct the code normally. but as the students save their submission the Indentation is gone and the order ruined.
I'm adding 3 pics which describe the problem
hope to find effective answer.

thanks in advance
Miki





העלאת תמונות - סיז



העלאת תמונות - סיז

העלאת תמונות - סיז
Average of ratings: -
In reply to Miki Alliel

Re: Can't keep the Indentation code after saving...

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators
there is a moodle function the format the text (see xref for format_text() )
and i guess it is converting it to simple text and then all the
previous formatting is gone.

try to disable it in the code, thou i think it is a kind of a security risk
(injection of flash objects or other malicious code. but i am soooooo NOT a security expert to really write (say) anything about it. please consult with some of the other developers)
In reply to Miki Alliel

Re: Can't keep the Indentation code after saving...

by Marius Pretorius -
The bug has been reported MDL-16291 and you can vote for it to be fixed. You need to create a separate user account for the bug tracking 'forum'. You can then vote on the issue and leave comments. I've just voted for it.

You may also change to use the HTML Purifier instead of KSES for cleaning of the code. You do this by going to Site Administration>Miscellaneous>Experimental and choose 'Enable HTML Purifier'. Note that it doesn't support MathML tags.

Greetings
Marius

In reply to Marius Pretorius

תשובה ל: Re: Can't keep the Indentation code after saving...

by Miki Alliel -
Picture of Translators
Hey, thanks I'v tried it, it still did'nt work
I hope in Moodle 2 it will be fixed
In reply to Miki Alliel

Re: Can't keep the Indentation code after saving...

by barbara beckmeyer -
Give this a try....have your students first click on the <> icon in the text editor tool bar. Then before they enter in the code they must use the <PRE> tag to display the code properly...don't forget to close the </PRE>

I tested it out and it worked for me using 1.9.5
Attachment html.jpg
Average of ratings: Useful (1)
In reply to barbara beckmeyer

תשובה ל: Re: Can't keep the Indentation code after saving...

by Miki Alliel -
Picture of Translators
Thanks for you answer.
They tried it too, but with no success. I tried it with Moodle1.9.5 but again the Indentation was removed. - don't know why .
In reply to Miki Alliel

Re: תשובה ל: Re: Can't keep the Indentation code after saving...

by barbara beckmeyer -
You may want to check with your systems administrator and see if there is something in the back end that he/she can adjust I tried it again and it worked.
In reply to barbara beckmeyer

תשובה ל: Re: תשובה ל: Re: Can't keep the Indentation code after saving...

by Miki Alliel -
Picture of Translators
Can enyone help me with this one?
thanks