Details

    • Testing Instructions:
      Hide
      1. Login as Admin, goto a course and add a choice activity
      2. view the activity and check the html source of the page.
      3. Make sure you see the id as an attribute to the input field.
      4. Make sure the for attribute of the label filed is same as the id attribute of input field
      5. Example:-
        <input id="choice_1" type="radio" name="answer" value="red" />
        <label for="choice_1">Red</label>
        
      Show
      Login as Admin, goto a course and add a choice activity view the activity and check the html source of the page. Make sure you see the id as an attribute to the input field. Make sure the for attribute of the label filed is same as the id attribute of input field Example:- <input id= "choice_1" type= "radio" name= "answer" value= "red" /> <label for = "choice_1" >Red</label>
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-30815-master
    • Rank:
      33756

      Description

      Each input element needs to be explicitly tied to a form label. The correct code looks like the following.

      <input id="choice_1" type="radio" name="answer" value="red" />
      <label for="choice_1">Red</label>
      
      <input id="choice_2" type="radio" name="answer" value="blue" />
      <label for="choice_2">Blue</label>
      
      <input id="choice_3" type="radio" name="answer" value="green" />
      <label for="choice_3">Green</label>
      

      The key is to have each input element directly attached to a label through a common "id" and "for" attribute.

        Activity

        Greg Kraus created issue -
        Greg Kraus made changes -
        Field Original Value New Value
        Priority Minor [ 4 ] Critical [ 2 ]
        Greg Kraus made changes -
        Priority Critical [ 2 ] Major [ 3 ]
        Glenn Ansley made changes -
        Parent MDL-27843 [ 44849 ]
        Issue Type Bug [ 1 ] Sub-task [ 5 ]
        Hide
        Michael de Raadt added a comment -

        Here's one we can fix a bit quicker. I'm slapping this one straight into the next STABLE Sprint.

        I had a look a the current situation and there are labels, but they are not correctly linked to the radio inputs. Here is an example of a current form (made pretty).

        ...
        <form method="POST" action="http://localhost/moodle_testing/mod/choice/view.php" class="horizontal">
        <ul class="choices">
            <li class="option"><input value="65" name="answer" type="radio" /><label for="answer">Red</label></li>
            <li class="option"><input value="66" name="answer" type="radio" /><label for="answer">Green</label></li>
            <li class="option"><input value="67" name="answer" type="radio" /><label for="answer">Blue</label></li>
            <li class="option"><input value="68" name="answer" type="radio" /><label for="answer">Yellow</label></li>
            ...
        
        Show
        Michael de Raadt added a comment - Here's one we can fix a bit quicker. I'm slapping this one straight into the next STABLE Sprint. I had a look a the current situation and there are labels, but they are not correctly linked to the radio inputs. Here is an example of a current form (made pretty). ... <form method= "POST" action= "http: //localhost/moodle_testing/mod/choice/view.php" class= "horizontal" > <ul class= "choices" > <li class= "option" ><input value= "65" name= "answer" type= "radio" /><label for = "answer" >Red</label></li> <li class= "option" ><input value= "66" name= "answer" type= "radio" /><label for = "answer" >Green</label></li> <li class= "option" ><input value= "67" name= "answer" type= "radio" /><label for = "answer" >Blue</label></li> <li class= "option" ><input value= "68" name= "answer" type= "radio" /><label for = "answer" >Yellow</label></li> ...
        Michael de Raadt made changes -
        Fix Version/s STABLE Sprint 17 [ 11550 ]
        Description Each input element needs to be explicitly tied to a form label. The correct code looks like the following.

        <input id="choice_1" type="radio" name="answer" value="red" />
        <label for="choice_1">Red</label>

        <input id="choice_2" type="radio" name="answer" value="blue" />
        <label for="choice_2">Blue</label>

        <input id="choice_3" type="radio" name="answer" value="green" />
        <label for="choice_3">Green</label>

        The key is to have each input element directly attached to a label through a common "id" and "for" attribute.
        Each input element needs to be explicitly tied to a form label. The correct code looks like the following.

        {code}
        <input id="choice_1" type="radio" name="answer" value="red" />
        <label for="choice_1">Red</label>

        <input id="choice_2" type="radio" name="answer" value="blue" />
        <label for="choice_2">Blue</label>

        <input id="choice_3" type="radio" name="answer" value="green" />
        <label for="choice_3">Green</label>
        {code}

        The key is to have each input element directly attached to a label through a common "id" and "for" attribute.
        Labels triaged
        Difficulty Easy [ 10023 ]
        Hide
        Michael de Raadt added a comment -

        Hi, Dan.

        I've assigned this to you as the component owner. If you like you can take this through, or leave it to us and it will be done.

        Show
        Michael de Raadt added a comment - Hi, Dan. I've assigned this to you as the component owner. If you like you can take this through, or leave it to us and it will be done.
        Michael de Raadt made changes -
        Assignee moodle.com [ moodle.com ] Dan Marsden [ danmarsden ]
        Ankit Agarwal made changes -
        Assignee Dan Marsden [ danmarsden ] Ankit Agarwal [ ankit_frenz ]
        Ankit Agarwal made changes -
        Status Open [ 1 ] Development in progress [ 3 ]
        Ankit Agarwal made changes -
        Pull Master Diff URL https://github.com/ankitagarwal/moodle/compare/MDL-30815-master
        Pull Master Branch MDL-30815-master
        Testing Instructions # Login as Admin, goto a course and add a choice activity
        # view the activity and check the html source of the page.
        # Make sure you see the id as an attribute to the input field.
        # Make sure the for attribute of the label filed is same as the id attribute of input field
        # Example:-
        {code}
        <input id="choice_1" type="radio" name="answer" value="red" />
        <label for="choice_1">Red</label>
        {code}
        Pull from Repository git://github.com/ankitagarwal/moodle.git
        Ankit Agarwal made changes -
        Status Development in progress [ 3 ] Waiting for peer review [ 10012 ]
        Andrew Davis made changes -
        Original Estimate 0 minutes [ 0 ]
        Remaining Estimate 0 minutes [ 0 ]
        Status Waiting for peer review [ 10012 ] Peer review in progress [ 10013 ]
        Peer reviewer andyjdavis
        Hide
        Andrew Davis added a comment -

        Looks like a sensible change to me.

        Show
        Andrew Davis added a comment - Looks like a sensible change to me.
        Andrew Davis made changes -
        Status Peer review in progress [ 10013 ] Development in progress [ 3 ]
        Ankit Agarwal made changes -
        Ankit Agarwal made changes -
        Hide
        Ankit Agarwal added a comment -

        Thanks Andrew for the review.
        Sending to integration!

        Show
        Ankit Agarwal added a comment - Thanks Andrew for the review. Sending to integration!
        Ankit Agarwal made changes -
        Status Development in progress [ 3 ] Waiting for integration review [ 10010 ]
        Eloy Lafuente (stronk7) made changes -
        Currently in integration Yes [ 10041 ]
        Sam Hemelryk made changes -
        Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
        Integrator samhemelryk
        Hide
        Sam Hemelryk added a comment -

        Thanks Ankit this has been integrated now.

        Show
        Sam Hemelryk added a comment - Thanks Ankit this has been integrated now.
        Sam Hemelryk made changes -
        Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
        Fix Version/s 2.1.5 [ 11553 ]
        Fix Version/s 2.2.2 [ 11552 ]
        Michael de Raadt made changes -
        Tester phalacee
        Jason Fowler made changes -
        Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
        Hide
        Jason Fowler added a comment -

        all good

        Show
        Jason Fowler added a comment - all good
        Jason Fowler made changes -
        Status Testing in progress [ 10011 ] Tested [ 10006 ]
        Hide
        Eloy Lafuente (stronk7) added a comment -

        It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks!

        Closing as fixed, heading to zzzZZZzzz, niao

        Show
        Eloy Lafuente (stronk7) added a comment - It is late here and I'm very tired but I didn't want to go to sleep before expressing my admiration for your amazing collaboration. Thanks! Closing as fixed, heading to zzzZZZzzz, niao
        Eloy Lafuente (stronk7) made changes -
        Status Tested [ 10006 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Currently in integration Yes [ 10041 ]
        Eloy Lafuente (stronk7) made changes -
        Integration date 17/Feb/12
        Eloy Lafuente (stronk7) made changes -
        Fix Version/s STABLE Sprint 17 [ 11550 ]

          People

          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: