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

Review essay formatting issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Deferred
    • Affects Version/s: 2.0, 2.1
    • Fix Version/s: None
    • Component/s: Lesson
    • Labels:
      None
    • Testing Instructions:
      Hide

      Create a lesson with at least one essay question in it.
      Lesson Settings: Flow control: Display default feedback: Yes
      Log in as student.
      Go to lesson.
      Attempt Essay, making sure to use some formatting in your text (bold, italics, etc.).
      Click Submit button
      Check that the Essay text you entered is correctly formatted, and not displayed with HTML tags instead.

      Show
      Create a lesson with at least one essay question in it. Lesson Settings: Flow control: Display default feedback: Yes Log in as student. Go to lesson. Attempt Essay, making sure to use some formatting in your text (bold, italics, etc.). Click Submit button Check that the Essay text you entered is correctly formatted, and not displayed with HTML tags instead.
    • Workaround:
      Hide

      This patch solves the problem:
      in file mod/lesson/locallib.php, final public function record_attempt($context) { }
      towards line 2020 change

      if ($result->response) {
          if ($this->lesson->review && !$result->correctanswer && !$result->isessayquestion) {
          ...
          } else {...

      to

      if ($result->response) {
          if ($this->lesson->review && !$result->correctanswer && !$result->isessayquestion) {
          ...
          } else {
              if ($result->isessayquestion) {
      	    $result->studentanswer = '<div class="reviewessay">'.htmlspecialchars_decode ($result->studentanswer).'</div>';
              }
              ...

      tested on moodle 2.0 and 2.1

      Show
      This patch solves the problem: in file mod/lesson/locallib.php, final public function record_attempt($context) { } towards line 2020 change if ($result->response) { if ($this->lesson->review && !$result->correctanswer && !$result->isessayquestion) { ... } else {... to if ($result->response) { if ($this->lesson->review && !$result->correctanswer && !$result->isessayquestion) { ... } else { if ($result->isessayquestion) { $result->studentanswer = '<div class="reviewessay">'.htmlspecialchars_decode ($result->studentanswer).'</div>'; } ... tested on moodle 2.0 and 2.1
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE

      Attachments

        Issue Links

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            rezeau Joseph Rézeau
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: