html in the lessons

html in the lessons

by Erik Ringmar -
Number of replies: 4

Dear all,

My entries in the lesson module look terrible -- the page breaks are all in strange places -- and all my attempts to do something about it with the HTML editor have been in vain.  Why would this be?  I'm not using any particular themes, I'm not daring to touch CSS.  No one else seems to have reported a similar problem.  Please help!

cheers,

Erik

Average of ratings: -
In reply to Erik Ringmar

Re: html in the lessons

by Erik Ringmar -
Hi again,

I've been struggling for a couple of more hours.  It seems the problem is that I'm importing text from various other applications and that line-breaks remain.  I'm now removing them one by one by hand and it's really terrible.  Any suggestions?

Erik
In reply to Erik Ringmar

Re: html in the lessons

by Steve Garcia -
Are you editing the text as raw HTML code or as rendered text?

I've had the best luck when trying to fix problems like that by doing so as raw HTML -- unfortunatley, search and replace don't work in the HTML Editor when you're in source code mode.  There have been several times when I've just broken down and cut and pasted the whole mess into an external text editor, fixed it, and then pasted it back into the HTML Editor.
In reply to Steve Garcia

Re: html in the lessons

by Erik Ringmar -
Thanks Steve,

That's what I ended up doing.  But manually chasing invisible code is a really horrid task.  There should be a health warning somewhere telling Moodle users not to cut and past externally generated masses of text.

cheers,

Erik
In reply to Erik Ringmar

Re: html in the lessons

by Clarence Prudhoe -

Hi, I posted this in another string but it seems to fit here to.

You can use code generated in other editors including forms, PHP, Java script, etc. if you first go to your Moodle configuration/editor settings and change the htmleditor to "do not allow". Thus, when you edit a page, only the html script editor will open.  You can also open the html editor then toggle to the script editor <> and paste your script in but if you open the html editor again, it will mess up your code.

Your imported script should now work. However if you turn the HTML editor back on and then attempt to edit this page, the Moodle HTML editor will attempt to rewrite your script and it will will chew it all up. I keep a backup copy of the script I enter into Moodle in a Word Pad file so I can fix it if I forget and mess up the script by entering the editor.

I think you will want to leave the htmleditor on for general use but you can turn it off to build special pages.

Let me know if this works for you.

Clarence

Paste only the script inside the body (do not use the body tags) into the Moodle script editor then save the page.  Moodle genterates the header and body tags, etc. automatically.