Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.3
-
MOODLE_23_STABLE
-
MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
-
Description
When importing a question in Moodle XML format, where the question contains multiline (non-html) text fields, an extra space is inserted at the start of every line. For example, if the xml description of a question contains a tag like
<text>line1
line2
line3
</text>
the imported value of that text field will be "line1\n line2\n line3\n " (note the extra spaces). The cause is the first line in the function readquestions in file question/format/xml/format.php: "$text = implode($lines, ' ');" which is intended to combine all the file lines into one big string, but does so with an extra space introduced at the start of each line.