studentquiz / moodle-mod_studentquiz

Moodle-Plugin
GNU General Public License v3.0
38 stars 38 forks source link

StudentQuiz: Linebreaks in comments are not correctly displayed #403

Closed BruceGoodGuy closed 2 years ago

BruceGoodGuy commented 2 years ago

Hi @timhunt , In this commit, I have fixed the issue: Add the space between lines when collapsing the comment. Step to reproduce:

  1. Create a StudentQuiz
  2. Add a question (e.g., T/F)
  3. Click on Start Quiz, attempt the question
  4. In the comment section, add a comment with a few line breaks in between.
  5. Collapse the comment

Actual result: When collapsed, the whitespace between lines is also missing. image

Expected result: The space should exist to divide the lines when collapsing the comment. image

timhunt commented 2 years ago

Why do we need to write our own HTML to text and/or shorten_text functions? Both already exist in Moodle core, and, for example, the core one replaces each image with its alt text, which is better.

So, sorry, we can't merge this.