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

Line breaks in "Long text answer" in "Responses" file of Feedback module trimmed.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.0.9, 4.1.4, 4.2.1
    • Feedback

      When downloading "Responses" in the Feedback module, the download file is generated with the line breaks in the text entered in the "Long text answer" field trimmed.

      Testing Instructions:

      1. Login as Site admin.
      2. Go to a certain course (eg. "MDL001").
      3. Press "Turn editing on".
      4. Add the "Feedback" module (eg. "For Moodle Tracker").
      5. Go to the Feedback page.
      6. Press "Edit questions".
      7. Select "Long text answer" on "Choose ..." pull-down menu.
      8. Type in "Long text answer 001".
      9. Press "Save question".
      10. Press "Back".
      11. Press "Answer the questions".
      12. Type in the following text:

        Line001

        Line002

        Line003

      13. Press "Submit your answers".
      14. Press "Continue".
      15. Go to the Feedback page.
      16. Press "Responses" tab.
      17. Press "Download".
      18. Check the downloaded CSV file "For Moodle Tracker.csv"
      19. Ensure that line breaks are removed from the content of the "Long text answer 001" column in the downloaded csv file.

      Solution:
      We can modify the related program file as below.

      Program file to modify:
      lib/tablelib.php

      Line:
      2221

      [ Before ]
      function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL)

      { //use some whitespace to indicate where there was some line spacing. $text = str_replace(array('</p>', "\n", "\r"), ' ', $text); return html_entity_decode(strip_tags($text), ENT_COMPAT); }

       

      [ After ]
      function format_text($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL)

      { //use some whitespace to indicate where there was some line spacing. $text = str_replace(array('</p>', "\n\n", "\r"), ' ', $text); return html_entity_decode(strip_tags($text), ENT_COMPAT); }

       

            Unassigned Unassigned
            mits Mitsuhiro Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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