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

In question management, category selection fields do escape < > and & in optgroup labels

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.5, 3.3.2, 3.4, 3.9.6, 3.10.3, 3.11
    • Fix Version/s: 3.9.7, 3.10.4
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      Category selector

      1. Log in as manager, or at least a role which has course category creation capabilities.
      2. Open Course and category management course/management.php?categoryid=0.
      3. Click "Create new category" to create a course category under Miscellaneous called "fish & chips".
      4. Create new category "0 < 1" in the new "fish & chips" category.
      5. Create new category "2 > 1" in the new "0 < 1" category.
      6. Create new category 'Double " quotes' in the new "2 > 1" category.
      7. Create new category "Single ' quote" in the new 'Double " quotes' category.
      8. Create a course "question bank test course" in the new "Single ' quote" category
      9. Go to that course's question bank question/edit.php?courseid=XX* Select the pull down menu "Select a category"
      10. Verify the <, > and & is correctly displayed and not entity escaped.

      Move question to a category selector

      1. Go to course question bank, to the 'questions' tab.
      2. Create a question.
      3. Select the question.
      4. In the select menu next to "Move to >>" verify the <, > and & is correctly displayed and not entity escaped.

      "Add a category" parent category selector

      1. Go to course question bank, to the 'categories' tab.
      2. In the "Add category" "Parent category" select menu verify the <, > and & is correctly displayed and not entity escaped.
      Show
      Category selector Log in as manager, or at least a role which has course category creation capabilities. Open Course and category management course/management.php?categoryid=0. Click "Create new category" to create a course category under Miscellaneous called "fish & chips". Create new category "0 < 1" in the new "fish & chips" category. Create new category "2 > 1" in the new "0 < 1" category. Create new category 'Double " quotes' in the new "2 > 1" category. Create new category "Single ' quote" in the new 'Double " quotes' category. Create a course "question bank test course" in the new "Single ' quote" category Go to that course's question bank question/edit.php?courseid=XX* Select the pull down menu "Select a category" Verify the <, > and & is correctly displayed and not entity escaped. Move question to a category selector Go to course question bank, to the 'questions' tab. Create a question. Select the question. In the select menu next to "Move to >>" verify the <, > and & is correctly displayed and not entity escaped. "Add a category" parent category selector Go to course question bank, to the 'categories' tab. In the "Add category" "Parent category" select menu verify the <, > and & is correctly displayed and not entity escaped.
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_39_STABLE
    • Pull 3.9 Branch:
      MDL-60331-39_take3
    • Pull 3.10 Branch:
      MDL-60331-310_take3
    • Pull 3.11 Branch:
      MDL-60331-311_take3
    • Pull Master Branch:
      MDL-60331-master_take3

      Description

      Steps to reproduce:

      • Log in as manager, or at least a role which has course category creation capabilities.
      • Open Course and category management course/management.php?categoryid=0.
      • Click "Create new category" to create a course category under Miscellaneous called "fish & chips".
      • Create new category "0 < 1" in the new "fish & chips" category.
      • Create new category "2 > 1" in the new "0 < 1" category.
      • Create new category 'Double " quotes' in the new "2 > 1" category.
      • Create new category "Single ' quote" in the new 'Double " quotes' category.
      • Create a course "question bank test course" in the new "Single ' quote" category
      • Go to that course's question bank question/edit.php?courseid=XX* Select the pull down menu "Select a category"

          
      What you see:
      The title for the fourth entry states "Category: 2 > 1"
      The title for the fifth entry states "Category: 0 < 1"
      The title for the sixth entry states "Category: fish & chips"
          
      What you expect:
      The title for the fourth entry states "Category: 2 % gt; 1"
      The title for the fifth entry states "Category: 0 & lt; 1"
      The title for the sixth entry states "Category: fish & amp; chips"

      This also applies for the selection when moving question ("With selected:" "move to>>").
      The values are set in the select field's optgroup labels.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lucaboesch Luca Bösch
              Reporter:
              lucaboesch Luca Bösch
              Peer reviewer:
              Tim Hunt Tim Hunt
              Integrator:
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Tester:
              Gladys Basiana Gladys Basiana
              Participants:
              Component watchers:
              Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/May/21

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 5 minutes
                  1h 5m