Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-61117

HTML tidy filter when installed and enabled breaks cloze question type



    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.9
    • Fix Version/s: None
    • Component/s: Filters
    • Labels:
    • Affected Branches:


      When enabling the HTML tidy filter using php7.0 on ubuntu 16.04, the filter causes the cloze question type to break and not correctly replace the markers for each subquestion, as it breaks the html markup such that the str replace in the multi answer question type renderer no longer matches (due to odd line breaks appearing in the final html markup, apparently inserted by the HTML tidy filter)


      Steps to reproduce

      1) Setup a local 3.1.9 copy of Moodle, ubuntu 16.04, apache with php7.0

      2) ensure the tidy module is installed, e.g sudo apt-get install php7.0-tidy

      3) Enable the HTML tidy filter (interesting side note, this appears to be a no-op unless the tidy module is actually installed, which took me a while to figure out why I couldn't reproduce the issue in my dev environment at first)

      4) Create a new course with defaults as normal

      5) Create a quiz in the course, leave all settings on default

      6) Create a single question in the quiz, type: Embedded Answers(Cloze)

      7) For the answer text use the sample provided by the Moodle wiki


      8) Observe that when you preview the quiz, not all of the subquestions are inserted correctly

      eg: Questions not being inserted


      9) Disable the HTML Tidy filter and observe that the sub questions now appear correctly.


      NB: I have not tested this on php5.x as I was unable to install a tidy package for php5.x, curious to hear if anyone else is able to replicate the issue on php versions less than 7.0




            • Assignee:
              devinefran Francis Devine
              Component watchers:
              Jake Dallimore, Jun Pataleta
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: