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

Quiz Responses converts new line characters to 6 spaces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.0.6
    • Quiz
    • MOODLE_400_STABLE

      I need to export student quiz responses (e.g. to csv or json) using the download feature available in "Quiz settings:Responses".

      If a student's answer includes text containing new-line characters (ASCII 13), then these get converted into 6 space characters.  Thus it is not possible to reconstruct the student's correctly laid out multiple-line text answer.  If the student's response was a python-code answer, where white space formatting and indentation is vital to parsing the python code, then this is now impossible to do correctly.  I believe this problem did not happen with Moodle version 3. 

      For example if the student's answer is

      "def f(arg):

           print(arg)"

      when I download it to csv or json, it gets converted into

      "def f(arg):          print(arg)"

      I have seen this bug affect CodeRunner question types, but apparently it also affects other question types (e.g. essay) too.  The problem affects the "download" facility of the responses page, but also seems to affect the display of the responses too (on the responses page).

            Unassigned Unassigned
            MichaelF Michael Fairbank
            Votes:
            18 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 30 minutes
                30m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.