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

Assignment word count broken if garbage HTML entered

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.9.4, 3.0
    • Fix Version/s: None
    • Component/s: Assignment
    • Labels:
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE

      Description

      1. Create an assignment and check 'Online text' as a 'Submission type' and set the 'Word limit' to 50.
      2. Log in as a student and go to the assignment submission screen.
      3. In the editor change to the HTML mode and enter -

        <p></p><pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:9pt;"><span style="color:#008000;background-color:#f7faff;font-weight:bold;">one<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">two<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">three<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">four<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">five<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">six<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">seven<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">eight<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">nine<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">ten<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">eleven<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">twelve,<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">thirteen;<br></span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"</span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">fourteen</span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"</span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">!<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">FIFTEEN!!<br></span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"</span><span style="background-color:#ffcccc;">\S</span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">ixteen</span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"</span><span style="color:#008000;background-color:#f7faff;font-weight:bold;"><br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">---<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">'</span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"</span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">Seventeen</span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"</span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">'<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">'Eighteen</span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"<br></span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"</span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">nine</span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"</span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">teen</span><span style="color:#000080;background-color:#f7faff;font-weight:bold;">\"</span><span style="color:#008000;background-color:#f7faff;font-weight:bold;"><br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">twenty<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">twentyone<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">twenty!!!#2<br></span><span style="color:#008000;background-color:#f7faff;font-weight:bold;">twentythree</span></pre>
        

      4. View the submission as a student and you will notice the word count is wrong.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                markn Mark Nelson
                Participants:
                Component watchers:
                Damyon Wiese, Adrian Greeve, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: