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

Allow HTML in calculated multichoice question's options

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 4.4
    • 3.7.3, 3.8, 4.1.5, 4.2.2, 4.3
    • Questions
    • MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MOODLE_404_STABLE
    • MDL-67335_master
    • Hide
      1. Update your preferences in order to use "Plain text area" as your preferred editor.
      2. In a question bank, import the file "MDL-67335_example.xml" in
        "Moodle XML format" file format. It contains a calculated multichoice question created before this change.
      3. Go to the question bank. Find the question "Example question calculatedmulti". Next to the question, click "Edit" and then, from the menu, choose "Edit question".
      4. In the "Answers" section, verify that the format for "Choice 1" and "Choice 2" is "Plain text format".
      5. Click "Save changes".
      6. Click "Next page" on the following "Choose wildcards dataset properties" page.
      7. Click "Add" on "Add item 1 new set(s) of wild card(s) values" on the following "Edit the wildcards datasets" page.
      8. In the section "Set 1", set "Wild card {x}" to "5".
      9. Click "Save Changes".
      10. Being back in the question bank, find the question "Example question calculatedmulti". Next to the question, click "Edit" and then, from the menu, choose "Preview".
      11. Verify that the first answer is "5<sup>2</sup>". (That's verbatim, i. e. with the HTML tags spelled out.)
      12. Click "Close preview".
      13. Being back in the question bank, find the question "Example question calculatedmulti". Next to the question, click "Edit" and then, from the menu, choose "Edit question".
      14. In the "Answers" section, for "Choice 1", set the format to "HTML format" without changing the text.
      15. For "Choice 2", set the text to "{x}<sup>3</sup>" without changing the format.
      16. Click "Save changes".
      17. Click "Next page" on the following "Choose wildcards dataset properties" page.
      18. Click "Save changes" on the following "Edit the wildcards datasets" page.
      19. Being back in the question bank, find the question "Example question calculatedmulti". Next to the question, click "Edit" and then, from the menu, choose "Preview".
      20. Verify that the first answer is "5²", i.e. the number "5" with a superscript "2".
      21. Verify that the second answer is "5<sup>3</sup>". (That's verbatim, i. e. with the HTML tags spelled out.)
      Show
      Update your preferences in order to use "Plain text area" as your preferred editor. In a question bank, import the file " MDL-67335 _example.xml" in "Moodle XML format" file format. It contains a calculated multichoice question created before this change. Go to the question bank. Find the question "Example question calculatedmulti". Next to the question, click "Edit" and then, from the menu, choose "Edit question". In the "Answers" section, verify that the format for "Choice 1" and "Choice 2" is "Plain text format". Click "Save changes". Click "Next page" on the following "Choose wildcards dataset properties" page. Click "Add" on "Add item 1 new set(s) of wild card(s) values" on the following "Edit the wildcards datasets" page. In the section "Set 1", set "Wild card {x}" to "5". Click "Save Changes". Being back in the question bank, find the question "Example question calculatedmulti". Next to the question, click "Edit" and then, from the menu, choose "Preview". Verify that the first answer is "5<sup>2</sup>". (That's verbatim, i. e. with the HTML tags spelled out.) Click "Close preview". Being back in the question bank, find the question "Example question calculatedmulti". Next to the question, click "Edit" and then, from the menu, choose "Edit question". In the "Answers" section, for "Choice 1", set the format to "HTML format" without changing the text. For "Choice 2", set the text to "{x}<sup>3</sup>" without changing the format. Click "Save changes". Click "Next page" on the following "Choose wildcards dataset properties" page. Click "Save changes" on the following "Edit the wildcards datasets" page. Being back in the question bank, find the question "Example question calculatedmulti". Next to the question, click "Edit" and then, from the menu, choose "Preview". Verify that the first answer is "5²", i.e. the number "5" with a superscript "2". Verify that the second answer is "5<sup>3</sup>". (That's verbatim, i. e. with the HTML tags spelled out.)

      This is what you want

      This is what you get

      I think there should be a way of allowing this.

      TO REPRODUCE

      1. In your course, create a question of type calculated multichoice with the above options (ore import the attached Moodle XML export)
      2. Preview the question

      WHAT YOU EXPECT

      Superscript numbers

      WHAT ACTUALLY HAPPENS

      <sup></sup> tags are escaped in the code and therefore shown in the question's options.

       

      Note that in the editing windows of the wild card sets the superscript is displayed correctly which is intriguing.

      This leads me to tend to classify this as a bug.

        1. image-2020-01-23-17-56-36-218.png
          image-2020-01-23-17-56-36-218.png
          68 kB
        2. MDL-67335_example.xml
          2 kB
        3. MDL-67335_mobile.png
          MDL-67335_mobile.png
          73 kB
        4. MDL-67335.png
          MDL-67335.png
          184 kB
        5. MDL-67335-after.png
          MDL-67335-after.png
          162 kB
        6. MDL-67335-bad.png
          MDL-67335-bad.png
          52 kB
        7. MDL-67335-good.png
          MDL-67335-good.png
          41 kB
        8. MDL-67335-mathjax.png
          MDL-67335-mathjax.png
          93 kB
        9. MDL-67335-preview_display.png
          MDL-67335-preview_display.png
          73 kB
        10. sup_in_calculated_multichoice_questions_answers_fixed.xml
          2 kB
        11. sup_in_calculated_multichoice_questions_answers.xml
          2 kB

            philippimhof Philipp Imhof
            lucaboesch Luca Bösch
            Luca Bösch Luca Bösch
            Ilya Tregubov Ilya Tregubov
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            4 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 40 minutes
                4h 40m

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