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

Matching question review html output is incorrect

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.3
    • Component/s: Questions
    • Labels:
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Detected @ MDLQA-697

      When reviewing one attempt, the output for matching questions is incorrect, showing the html tags and so one (surely it's not supporting the new format & images stuff).

        Gliffy Diagrams

        1. backup_test-2.0.mbz
          1.13 MB
          Eloy Lafuente (stronk7)
        1. afterpatch1.png
          36 kB
        2. afterpatch2.png
          39 kB
        3. broken_output.png
          50 kB

          Issue Links

            Activity

            Hide
            timhunt Tim Hunt added a comment -

            To test:

            1. Create a quiz with assorted question types. Including essay, short-answer and others.
            2. Make some attempts as a student. Type characters like < and & into the short answer response box.
            3. As a teacher, review those attempts. Make sure the response history table does not contain HTML tags (like it does in Eloy's scree-shot).
            4. Check that the Responses and Statistics quiz reports are also working properly.

            Show
            timhunt Tim Hunt added a comment - To test: 1. Create a quiz with assorted question types. Including essay, short-answer and others. 2. Make some attempts as a student. Type characters like < and & into the short answer response box. 3. As a teacher, review those attempts. Make sure the response history table does not contain HTML tags (like it does in Eloy's scree-shot). 4. Check that the Responses and Statistics quiz reports are also working properly.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Hi Tim,

            I'm halting PULL-390 until tomorrow because I've verified two situations still showing information incorrectly (both related), just in case you can fix them:

            1) afterpatch1.png: Shows how now the responses have an annoying formatting, surely due to the original <p> tags in action.
            2) afterpatch2.png: The same, but worse, because the original questions had images. So the output becomes more garbled, with the images pointing to non-converted @PLUGINFILE@.

            Perhaps the solution there would be to strip tags completely and forget? Not sure, you know the implications.

            In order to reproduce it, the attached backup contains exactly those questions (backup_test-2.0.mbz)

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Hi Tim, I'm halting PULL-390 until tomorrow because I've verified two situations still showing information incorrectly (both related), just in case you can fix them: 1) afterpatch1.png: Shows how now the responses have an annoying formatting, surely due to the original <p> tags in action. 2) afterpatch2.png: The same, but worse, because the original questions had images. So the output becomes more garbled, with the images pointing to non-converted @PLUGINFILE@. Perhaps the solution there would be to strip tags completely and forget? Not sure, you know the implications. In order to reproduce it, the attached backup contains exactly those questions (backup_test-2.0.mbz) Ciao
            Hide
            timhunt Tim Hunt added a comment -

            I am very tempted to just strip tags, since that is what happens in the new question engine in 2.1. But I thought I would have one go at making it work fully.

            The <p> tags are added by the HTML editor, and there is no easy way to avoid them. There was a discussion in developers' chat saying we need an option on the HTML editor to say "we are expecting a small snippet of HTML, don't add <p> tags around the whole things unless two or more paragraphs are entered."

            I'll try to do a better patch.

            Show
            timhunt Tim Hunt added a comment - I am very tempted to just strip tags, since that is what happens in the new question engine in 2.1. But I thought I would have one go at making it work fully. The <p> tags are added by the HTML editor, and there is no easy way to avoid them. There was a discussion in developers' chat saying we need an option on the HTML editor to say "we are expecting a small snippet of HTML, don't add <p> tags around the whole things unless two or more paragraphs are entered." I'll try to do a better patch.
            Hide
            timhunt Tim Hunt added a comment -

            OK, new patch at https://github.com/timhunt/moodle/compare/master...MDL-26517

            I think converting to plain text is the only sane way. Note that html_to_text replaces images with their alt text.

            Show
            timhunt Tim Hunt added a comment - OK, new patch at https://github.com/timhunt/moodle/compare/master...MDL-26517 I think converting to plain text is the only sane way. Note that html_to_text replaces images with their alt text.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Looks perfect now, thanks. Integrated!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Looks perfect now, thanks. Integrated!
            Hide
            mudrd8mz David Mudrak added a comment -

            Tested. Thanks Eloy for the report and Tim for the fix.

            Show
            mudrd8mz David Mudrak added a comment - Tested. Thanks Eloy for the report and Tim for the fix.

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/May/11