My Moodle page isn't displaying the way it looks in the editor

From K-Wiki

Jump to: navigation, search



My content looks great in the Moodle HTML editor, but it's all wrong when it's displayed in my course.


This issue most often shows up in Quiz questions where you're adding question answer code in the body of the question, but can show up elsewhere in your Moodle course as well.


The Moodle filter called "HTML tidy" thinks that your HTML code is malformed and is adding extra HTML to 'tidy' it up.

Some comments from e-mail sent to a Kwantlen instructor:

A Moodle filter called “HTML tidy” is adding HTML code to your quiz questions (especially the Cloze question type with short answers) because it thinks that once it runs into "{1:SHORTANSWER:=Apple}" in your question, the HTML table should be closed off. Essentially, it thinks your HTML hasn't been written properly.

The good news is that the HTML tidy filter can be turned off.


Solution 1

Turn off HTML tidy for the activity.

Here's how:

  1. Login to your Moodle course and go directly to the activity
  2. Gear icon on right> Filters
  3. A list of of filter settings will be displayed
  4. Set: HTML tidy: Off
  5. Then 'Save Changes'
Special Kudos to Catherine C. for finding this workaround.

Solution 2

Turn off HTML tidy for the entire course.

We recommend turning it off, then take a good look through your course to see if anything displays oddly. If everything looks okay you can choose to leave HTML tidy turned off – but keep it in mind if someone should report strange displays in your course in the future -- you'll have to fix your HTML code manually.

Here's how to turn 'HTML tidy' off:

  1. Login to your Moodle course
  2. Edit settings > Filters
  3. Set: HTML tidy: Off
  4. Don’t forget “Save changes” at the bottom of the page.
Personal tools