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

Html (head, meta and charset) tags required on button "download all submissions" for online text assignments

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.3, 2.3.2
    • Assignment
    • MOODLE_23_STABLE

      Hello,

      The HTML generated on a submission .html file when you download it using "download all button submissions" on online text assignments don´t have any HTML HEAD meta charset tag, so when you open it on a browser there are a lot of character error on language like French because there is no charset defined.

      The bug is generated on: moodle/mod/assign/submission/onlinetext/locallib.php, line: 229, as you can see in this code there is no html head:

      $submissioncontent = "<html><body>". format_text($finaltext, $onlinetextsubmission->onlineformat, array('context'=>$this->assignment->get_context())). "</body></html>";      //fetched from database

      It can be solve using this line:

      $submissioncontent = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'><html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'/></head>    <body>". format_text($finaltext, $onlinetextsubmission->onlineformat, array('context'=>$this->assignment->get_context())). "</body></html>";      //fetched from database

      I think there is another way to solve this issue, but it works for online-text assignments.

      what do you think?

            Unassigned Unassigned
            dacapri David Cabrera Primo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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