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

grade export to text file has trouble with grade feedback that contains line returns

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2.5
    • Fix Version/s: None
    • Component/s: Gradebook
    • Labels:
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      The grade export code is not properly encoding or escaping line returns, which are commonly used by instructors when entering extensive grade feedback.

      It's also not putting quotes (") around fields in csv format, which the standard trick for handling field content that may contain line breaks.

      These problems make it impossible to use the exported file without first fixing the scrambled columns/rows. Otherwise, Moodle will fail a "round trip" export/import of course grades. I would consider that to be an essential test of the gradebook export/import codebase, and one of the most common use cases.

      Some possible fixes:

      – if line returns are found in grade feedback, warn the user that they will be replaced with spaces if you export as text
      – put quotes (") around all fields when exporting as CSV *
      – escape line returns with an backslash, or encode them as html entities

      *This is what MS Excel does handle line breaks in spreadsheet cells. It works perfectly to export a spreadsheet as CSV, and reload.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              garretg Garret Gengler
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: