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

<pre> formatting problem on quiz gift import

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.10
    • Fix Version/s: 2.6.6, 2.7.3
    • Component/s: Quiz
    • Labels:

      Description

      Please view the following description in an edit tool. The formatting is different from the view it creates.

      Spaces removed improperly from imported gift using <pre> tag. It seems the <pre> works well as long as </pre> is on the same line. However if the preformat spans multiple lines leading spaces used for indention is removed.

      The lines method1(); method2(); and method3(); below should be on separate lines and indented 4 spaces. Look at it in the edit tool, it looks correct.

      What would running the test method print?
      public void test()

      { method1(); method2(); method3(); }

      The following gift format does not work. The spaces before method1(), method2(), and method3() are removed.

      ::Q001::
      <p>What would running the test method print?</p>
      <pre>
      public void test()<br />
      {<br />
      method1();<br />
      method2();<br />
      method3();<br />
      }<br />
      </pre>

      { =*+& }

      HOWEVER, the following does work properly and preserves the spacing.

      ::Q001::
      <p>What would running the test method print?</p>
      <pre>public void test()<br />{<br /> method1();<br /> method2();<br /> method3();<br />}<br /></pre>{ =*+& }

      It seems that pre is parsed properly as long as it is on a single line. But when multiple lines are spanned, the ending newline for each line and the beginning spaces of the next line are compressed into a single newline. Being able to import formatted programs using the first format would be a tremendous help to those of us trying to teach programming to novices.

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            joelswanson Joel Swanson
            Peer reviewer:
            Jean-Michel Vedrine
            Integrator:
            Dan Poltawski
            Tester:
            CiBoT
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/Nov/14