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

Quiz intro does not display if it only contains tags.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.9.12, 2.0.3
    • Fix Version/s: None
    • Component/s: Quiz
    • Labels:
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      When creating a quiz intro that is simply HTML (in my example it was a table with images (no text)) the intro is not displayed. However, when editing the HTML and adding ASCII characters it did. This occurs because of the if statement in mod/quiz/view.php (if (trim(strip_tags($quiz->intro)))). I am not sure if this is a bug or expected behaviour, but it does mean that the user is forced to enter text, but are not told this is necessary. Changing the if statement to if (!empty($quiz->intro)) solves this issue, but may introduce vulnerabilities. However, the intro is cleaned in the if statement anyways.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              timhunt Tim Hunt
              Reporter:
              markn Mark Nelson
              Participants:
              Component watchers:
              Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: