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

lesson: essay question shows html characters on review

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.2.1, 2.6
    • Fix Version/s: None
    • Component/s: Lesson
    • Environment:
      RHEL/ virtual machine/ production server
      iMac/ PHP MYSQL development server
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      create a lesson with display default feedback option set to true.
      create a question page of type essay
      view the essay question as student, enter an answer.
      see the text under 'your answer'

      Show
      create a lesson with display default feedback option set to true. create a question page of type essay view the essay question as student, enter an answer. see the text under 'your answer'
    • Workaround:
      Hide

      Changed line 2031 of /<mooodle dir>/mod/lesson/locallib.php
      from
      $result->feedback .= '<div class="correctanswer generalbox"><em>'.get_string("youranswer", "lesson").'</em> '. $result->studentanswer; // already in clean html

      to

      $result->feedback .= '<div class="correctanswer generalbox"><p><em>'.get_string("youranswer", "lesson").'</em></p>'. html_entity_decode($result->studentanswer) ;

      nb the 'your answer' string is wrapped in a paragraph tag to format correctly.

      Show
      Changed line 2031 of /<mooodle dir>/mod/lesson/locallib.php from $result->feedback .= '<div class="correctanswer generalbox"><em>'.get_string("youranswer", "lesson").'</em> '. $result->studentanswer; // already in clean html to $result->feedback .= '<div class="correctanswer generalbox"><p><em>'.get_string("youranswer", "lesson").'</em></p>'. html_entity_decode($result->studentanswer) ; nb the 'your answer' string is wrapped in a paragraph tag to format correctly.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_26_STABLE

      Description

      when a student uses the essay question in a lesson the summary page displays the html characters of their response eg,
      <p>Here is my essay</p>

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              pgee Peter Gee
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: