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

Need a Mustache helper method for html entities

    XMLWordPrintable

Details

    • MOODLE_310_STABLE
    • MOODLE_311_STABLE
    • MDL-70721-311
    • MDL-70721-master
    • Hide

      Setup

      1. Log in as admin
      2. Go to Site administration > Plugins > Enrolments > Manage enrol plugins
      3.  Enable "Publish as LTI tool"
      4. Go to Site administration > Language > Language customisation
      5. Select English
      6. Click on the 'Import custom strings' button
      7. Click on the 'Continue' button after the language pack is loaded by Moodle
      8. Upload the file customlang_en.zip into the upload area
      9. Set 'Import mode' on 'Create or update all strings from the component(s)'
      10. Click on the 'Import file' button
      11. Click on 'Continue'
      12. Click on the 'Save strings to language pack' button
      13. Click on the 'Continue' button
      14. Create a new course (do NOT enrol anyone into the course)
      15. Enter the course

      Test 1

      1. Log in as admin
      2. Go to Site administration > Users > Privacy and policies > Policy settings
      3. Set 'Site policy handler' to 'Policies (tool_policy)' and save changes
      4. Go to Site administration > Users > Privacy and policies > Manage policies
      5. Click on the 'New policy' button
      6. Create a new policy with the following values
        1. Name: my policy
        2. Summary: my summary
        3. Full policy: my full policy
        4. Show policy before showing other policies: No
        5. Agreement optional: No
        6. Policy status: Active
      7. Log out
      8. Go to the signup page
      9. Click on the N"e>x button
      10. Verify that you see 2 buttons with these exact titles:
        1. N"e>x<t
        2. C"<an>c"el

      Test 2

      1. Log in as admin
      2. Enable the 'Publish as LTI tool' enrolment plugin on your site.
      3. Visit a course
      4. Go to Course administration > Published as LTI tools
      5. View page source (usually Ctrl+u)
      6. Copy the source
      7. Visit https://validator.w3.org/nu/
      8. Set the check by field to 'text input' and replace the content of the text editor with what you copied on step 7
      9. Press the 'check' button
      10. Press the 'message filtering' button
      11. Verify that you don't see any errors
        Note: because of some recently integrated codes, you may see some irrelevant errors. Here is a list of errors that you can ignore, but there can be more. Please check with me if you see any error that is not listed here before failing this issue:
        1. Bad value “#” for attribute “type” on element “button”
        2. Duplicate ID “moremenu-dropdown[some-number]
        3. Attribute aria-expanded not allowed on element a at this point.

      Test 3

      1. Log in as admin
      2. Go to the 'Site home' page
      3. Click on the cog icon at the top right of the page and then click on 'More...'
      4. Go to Question bank > Questions
      5. Verify that there is a dropdown menu with the following placeholder text
        • Fil<t"er "by' t>ags...
      6. Click on the 'Create a new question...' button
      7. Verify that the opened dialogue has a button with this exact text
        • C"<an>c"el
      8. Create a true/false question
      9. After creating the question, click on the 'Edit' link next to the question
      10. Verify that the menu has an item with this exact text
        • It's the "Preview" button

      Test 4

      1. Log in as admin
      2. Go into a course
      3. From the navigation drawer, click on 'Grades'
      4. Go to the Setup tab
      5. Verify that you see a button with this exact title
        • S"a>v<e ch"an'ges

      Test 5

      1. Log in as admin
      2. Go to calendar
      3. Click on the 'New event' button
      4. Enable your screen reader
      5. Press Tab multiple times until the close button (the X button) is focused
      6. Verify that the screen reader says the following:
        • It's a "close" button

      Test 6

      1. Log in as admin
      2. Enable 'OAuth 2' authentication in site administration > plugins > authentication > manage authentication
      3. Go to site administration > server > OAuth 2 services
      4. Click on the 'Google' button
      5. Set the 'Name displayed on the login page' field to the following and then click on the 'Save changes' button
        • H"e>llo
      6. Log out
      7. Go to the login page
      8. Verify that the placeholder on the username and password fields says
        • It's the "Username" field
        • It's the "password" field
      9. Verify that you see a button with the exact label as the following
        • H"e>llo
      10. Put your mouse over the button
      11. Verify that the tooltip you see has the exact same text as the button's text (311 only)

      Test 7

      1. Open theme/boost/settings.php and edit the line that contains admin_setting_configcolourpicker to this
        • $setting = new admin_setting_configcolourpicker($name, $title, $description, '', ['selector'=>'.some .css .selector']);
      2. Log in as admin
      3. Go to Site administration > Appearance > Themes > Boost
      4. Verify the button next to the colour picker element has the following label
        • It's the "Preview" button

      Test 8

      1. Log in as admin
      2. Create a course
      3. Create 2 pages in the course with the following names (use the same for page content). 
        1. It's a page
        2. It's another "page" with > special < characters
      4. Enter the first page
      5. View page source (usually Ctrl+u)
      6. Copy the source
      7. Visit https://validator.w3.org/nu/
      8. Set the check by field to 'text input' and replace the content of the text editor with what you copied on step 6
      9. Press the 'check' button
      10. Press the 'message filtering' button
      11. Verify that you don't see any errors
        Note: because of some recently integrated codes, you may see some irrelevant errors. Here is a list of errors that you can ignore, but there can be more. Please check with me if you see any error that is not listed here before failing this issue:
        1. Bad value “#” for attribute “type” on element “button”
        2. Duplicate ID “moremenu-dropdown[some-number]
        3. Attribute aria-expanded not allowed on element a at this point.

      Test 9

      1. Open the file course/classes/management_renderer.php and in the function category_listitem_actions, modify
        • array('data-action' => $key, 'class' => 'action-'.$key)
          to
        • array('data-action' => $key, 'class' => 'action-'.$key, 'title' => $action['string'])
      2. Log in as admin
      3. Go to the course management page (Site administration > Courses > Manage courses and categories).
      4. Click on the gear icon of the 'Miscellaneous' category
      5. Hover your mouse over the create a new subcategory option
      6. Verify that the tooltip text is exactly the same as the text of the menu item

      Test 10

      1. Log in as admin
      2. Go into a course
      3. Create an assignment with the following values
        • Assignment name: It's an "assignment" with >special< chars
        • Completion tracking: Students can manually mark the activity as completed
        • Expect completed on: set it to sometime in tomorrow's date
      4. Enrol yourself into the course
      5. Go to dashboard
      6. Set the filter of the timeline block to show overdue events
      7. Set the filter of the timeline block to show all events
      8. Verify that you see the assignment is listed on the timeline block
      9. Hover your mouse over the title of the assignment
      10. Verify that you see a tooltip with the following text (because of a known issue, you'd see html entities instead of > and <)
        • It's an "assignment" with >special< chars should be completed
      Show
      Setup Log in as admin Go to Site administration > Plugins > Enrolments > Manage enrol plugins  Enable "Publish as LTI tool" Go to Site administration > Language > Language customisation Select English Click on the 'Import custom strings' button Click on the 'Continue' button after the language pack is loaded by Moodle Upload the file  customlang_en.zip  into the upload area Set 'Import mode' on 'Create or update all strings from the component(s)' Click on the 'Import file' button Click on 'Continue' Click on the 'Save strings to language pack' button Click on the 'Continue' button Create a new course (do NOT enrol anyone into the course) Enter the course Test 1 Log in as admin Go to Site administration > Users > Privacy and policies > Policy settings Set 'Site policy handler' to 'Policies (tool_policy)' and save changes Go to Site administration > Users > Privacy and policies > Manage policies Click on the 'New policy' button Create a new policy with the following values Name: my policy Summary: my summary Full policy: my full policy Show policy before showing other policies: No Agreement optional: No Policy status: Active Log out Go to the signup page Click on the N"e>x button Verify that you see 2 buttons with these exact titles: N"e>x<t C"<an>c"el Test 2 Log in as admin Enable the 'Publish as LTI tool' enrolment plugin on your site. Visit a course Go to Course administration > Published as LTI tools View page source (usually Ctrl+u) Copy the source Visit https://validator.w3.org/nu/ Set the check by field to 'text input' and replace the content of the text editor with what you copied on step 7 Press the 'check' button Press the 'message filtering' button Verify  that you don't see any errors Note: because of some recently integrated codes, you may see some irrelevant errors. Here is a list of errors that you can ignore, but there can be more. Please check with me if you see any error that is not listed here before failing this issue: Bad value “#” for attribute “type” on element “button” Duplicate ID “moremenu-dropdown [some-number] ” Attribute aria-expanded not allowed on element a at this point. Test 3 Log in as admin Go to the 'Site home' page Click on the cog icon at the top right of the page and then click on 'More...' Go to Question bank > Questions Verify that there is a dropdown menu with the following placeholder text Fil<t"er "by' t>ags... Click on the 'Create a new question...' button Verify that the opened dialogue has a button with this exact text C"<an>c"el Create a true/false question After creating the question, click on the 'Edit' link next to the question Verify that the menu has an item with this exact text It's the "Preview" button Test 4 Log in as admin Go into a course From the navigation drawer, click on 'Grades' Go to the Setup tab Verify that you see a button with this exact title S"a>v<e ch"an'ges Test 5 Log in as admin Go to calendar Click on the 'New event' button Enable your screen reader Press Tab multiple times until the close button (the X button) is focused Verify that the screen reader says the following: It's a "close" button Test 6 Log in as admin Enable 'OAuth 2' authentication in site administration > plugins > authentication > manage authentication Go to site administration > server > OAuth 2 services Click on the 'Google' button Set the 'Name displayed on the login page' field to the following and then click on the 'Save changes' button H"e>llo Log out Go to the login page Verify that the placeholder on the username and password fields says It's the "Username" field It's the "password" field Verify that you see a button with the exact label as the following H"e>llo Put your mouse over the button Verify that the tooltip you see has the exact same text as the button's text (311 only) Test 7 Open theme/boost/settings.php and edit the line that contains admin_setting_configcolourpicker to this $setting = new admin_setting_configcolourpicker($name, $title, $description, '', ['selector'=>'.some .css .selector'] ); Log in as admin Go to Site administration > Appearance > Themes > Boost Verify the button next to the colour picker element has the following label It's the "Preview" button Test 8 Log in as admin Create a course Create 2 pages in the course with the following names (use the same for page content).  It's a page It's another "page" with > special < characters Enter the first page View page source (usually Ctrl+u) Copy the source Visit https://validator.w3.org/nu/ Set the check by field to 'text input' and replace the content of the text editor with what you copied on step 6 Press the 'check' button Press the 'message filtering' button Verify  that you don't see any errors Note: because of some recently integrated codes, you may see some irrelevant errors. Here is a list of errors that you can ignore, but there can be more. Please check with me if you see any error that is not listed here before failing this issue: Bad value “#” for attribute “type” on element “button” Duplicate ID “moremenu-dropdown [some-number] ” Attribute aria-expanded not allowed on element a at this point. Test 9 Open the file course/classes/management_renderer.php and in the function category_listitem_actions, modify array('data-action' => $key, 'class' => 'action-'.$key) to array('data-action' => $key, 'class' => 'action-'.$key, 'title' => $action ['string'] ) Log in as admin Go to the course management page (Site administration > Courses > Manage courses and categories). Click on the gear icon of the 'Miscellaneous' category Hover your mouse over the create a new subcategory option Verify that the tooltip text is exactly the same as the text of the menu item Test 10 Log in as admin Go into a course Create an assignment with the following values Assignment name: It's an "assignment" with >special< chars Completion tracking: Students can manually mark the activity as completed Expect completed on: set it to sometime in tomorrow's date Enrol yourself into the course Go to dashboard Set the filter of the timeline block to show overdue events Set the filter of the timeline block to show all events Verify that you see the assignment is listed on the timeline block Hover your mouse over the title of the assignment Verify that you see a tooltip with the following text (because of a known issue, you'd see html entities instead of > and <) It's an "assignment" with >special< chars should be completed
    • 0
    • HQ Team International Sprint 6, HQ Team International Sprint 7, HQ Team International Sprint 8, HQ Team International Sprint 9, HQ Team International Sprin 10, HQ Team International CI H2-21

    Description

      The quote helper method is not always useful in some cases. The #quote helper is used when we want to avoid the situations where double quotes can break the JSON syntax. So in order to escape the double quotes we use the #quote helper. But that's only useful in JSON or Javascript. The reason is that the #quote helper escapes double quotes with a backslash. Whereas in HTML, we don't escape with a backslash. we need to replace double quotes with its HTML entity instead.

      Then we can use the new helper when we are working with attributes such as aria-label

      Attachments

        1. MDL-70721_Step 5.png
          54 kB
          Angelia Dela Cruz
        2. MDL-70721_Test 1.png
          61 kB
          Angelia Dela Cruz
        3. MDL-70721_Test 10.png
          132 kB
          Angelia Dela Cruz
        4. MDL-70721_Test 2.png
          243 kB
          Angelia Dela Cruz
        5. MDL-70721_Test 3_1.png
          84 kB
          Angelia Dela Cruz
        6. MDL-70721_Test 3_2.png
          124 kB
          Angelia Dela Cruz
        7. MDL-70721_Test 3_3.png
          114 kB
          Angelia Dela Cruz
        8. MDL-70721_Test 4.png
          86 kB
          Angelia Dela Cruz
        9. MDL-70721_Test 6.png
          65 kB
          Angelia Dela Cruz
        10. MDL-70721_Test 7.png
          110 kB
          Angelia Dela Cruz
        11. MDL-70721_Test 8.png
          236 kB
          Angelia Dela Cruz
        12. MDL-70721_Test 9.png
          167 kB
          Angelia Dela Cruz
        13. MDL-70721_Test Passed.png
          439 kB
          Gladys Basiana

        Activity

          People

            rezaie9 Shamim Rezaie
            rezaie9 Shamim Rezaie
            Dongsheng Cai Dongsheng Cai
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Gladys Basiana Gladys Basiana
            Amy Groshek, David Scotson, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              17/Jan/22

              Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 5 hours, 45 minutes
                3d 5h 45m