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

Invalid div under labels in multichoice answers

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Rerun test from MDL-68761

      Please test this in browsers Chrome, Firefox, Safari and IE / Edge

      1. Login as Admin
      2. Create a new Quiz and add a multiple choice question
      3. For choice 1 add and image
      4. For choice 2 add a paragraph of text
      5. For choice 3 add an audio file
      6. For choice 4 add a single word
      7. Preview / Attempt the quiz
      8. Verify the checkboxes, labels (a., b., c.) and the question content all align to the top. See sample expected output:
      HTML Validation
      1. View the page source, copy it and paste it on Nu HTML Validator (selecting "Check by source").
      2. Confirm that you don't get any errors related to the radio button and label of the answers.
      Axe
      1. Run the axe tool on the quiz page with the multiple-choice question.
      2. Confirm that you don't get any accessibility violations related to the radio button and label of the answers.
      Show
      Rerun test from MDL-68761 Please test this in browsers Chrome, Firefox, Safari and IE / Edge Login as Admin Create a new Quiz and add a multiple choice question For choice 1 add and image For choice 2 add a paragraph of text For choice 3 add an audio file For choice 4 add a single word Preview / Attempt the quiz Verify the checkboxes, labels (a., b., c.) and the question content all align to the top. See sample expected output: HTML Validation View the page source, copy it and paste it on Nu HTML Validator  (selecting "Check by source"). Confirm that you don't get any errors related to the radio button and label of the answers. Axe Run the axe tool on the quiz page with the multiple-choice question. Confirm that you don't get any accessibility violations related to the radio button and label of the answers.
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull 3.9 Branch:
      MDL-70032-39-2
    • Pull 3.10 Branch:
      MDL-70032-310-2
    • Pull Master Branch:
      MDL-70032-master-2

      Description

      The label element for a choice option contains a div that contains the question which is not allowed as per specifications.

      To reproduce:

      1. Create a multi-choice question
      2. Preview the question
      3. View the page source, copy it and paste it on Nu HTML Validator.
      4. Expected
        • Validation passes
      5. Actual
        • The following errors are encountered:

          Error: Element div not allowed as child of element label in this context. (Suppressing further errors from this subtree.)
           
          From line 530, column 338; to line 530, column 365
           
          a. </span><div class="flex-fill ml-1"><p>Nov
           
          Contexts in which element div may be used:
          Where flow content is expected.
          As a child of a dl element.
          Content model for element label:
          Phrasing content, but with no descendant labelable elements unless it is the element's labeled control, and no descendant label elements.
          

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jpataleta Jun Pataleta
              Reporter:
              jpataleta Jun Pataleta
              Peer reviewer:
              Mihail Geshoski
              Integrator:
              Víctor Déniz Falcón
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Nov/20

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 3 hours, 5 minutes
                  1d 3h 5m