Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCKIN-12227 Survey table labels and roles #67

Merged

Conversation

murad-hubib
Copy link
Contributor

@murad-hubib murad-hubib commented Nov 25, 2019

  • Added table roles
  • Added meaningful aria-labels of radio buttons for better accessibility

These are supportive attributes for accessibility and doesn't have any visual change

Ticket:

https://edx-wiki.atlassian.net/browse/MCKIN-12227

@xitij2000 Please review and merge it as per your schedule. Also please let me know if we need to bump the version as well

setup.py Outdated
@@ -45,7 +45,7 @@ def package_data(pkg, roots):

setup(
name='xblock-poll',
version='1.8.9',
version='1.9',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll get to the full review next sprint, but for the version I think you should keep the patch number, so 1.9.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xitij2000, this doesn't look like a big change, so shouldn't we just bump the patch version (1.8.10)?
I think bumping minor would be more suitable for a PR like #66.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Agrendalath Yeah, I wasn't commenting on the version bump itself, but mainly the format of the version number. I think 1.8.10 makes more sense here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Agrendalath I have bumped the version as well. Please go ahead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc: @xitij2000 as the reviewer here.

@murad-hubib murad-hubib closed this Jan 6, 2020
@murad-hubib murad-hubib deleted the murad/12227-survey-labels-roles branch January 6, 2020 10:54
@murad-hubib murad-hubib restored the murad/12227-survey-labels-roles branch January 6, 2020 10:55
@murad-hubib murad-hubib reopened this Jan 6, 2020
@xitij2000
Copy link
Member

@wittjeff This is a PR to improve accessibility of an XBlock that's included in edx-platform. Would you be able to have a quick look and see if it's going in the right direction?
I've tested on NVDA, but I'm not sure it's helping.

@msaqib52
Copy link
Contributor

@murad-hubib some test cases are failing, could you fix those in the meantime.

@xitij2000
Copy link
Member

@msaqib52 @murad-hubib Note that there are some failures that are not caused by this PR.
We have a task to fix those but it is unlikely we will get to it this sprint. If you'd like you can include those fixes as well, otherwise we will pick up that work when it's prioritised.

@wittjeff
Copy link

@murad-hubib @xitij2000 You code seems mostly sensible but I don't feel confident in saying so without seeing it live somewhere. Also it just seems to make the code "look" semantically more like the Poll component I see in Studio, so I don't know where these forked. Is there a sandbox with your changes?

And by the way, I don't mind looking over changes like this, but please understand that my inbox has a steady heavy flow of Github PR updates, and I may not notice when you tag me. So if I don't respond, just email me directly.

@wittjeff
Copy link

Here's DOM output from a poll in current Studio:

<h3 class="poll-header">Poll</h3>

<form>
  <fieldset class="poll-container">
    <legend class="poll-question">
      <p>What is your favorite color?</p>
    </legend>
    <div class="poll-answers">
      
        <div class="poll-answer">
          <div class="poll-input-container">
            <input type="radio" name="choice" id="poll-ca0352665a474c4a94cfc8707666fed6-answer-R" value="R">
          </div>
          
          <label class="poll-answer-text" for="poll-ca0352665a474c4a94cfc8707666fed6-answer-R"><p>Red</p></label>
        </div>
      
        <div class="poll-answer">
          <div class="poll-input-container">
            <input type="radio" name="choice" id="poll-ca0352665a474c4a94cfc8707666fed6-answer-B" value="B">
          </div>
          
          <label class="poll-answer-text" for="poll-ca0352665a474c4a94cfc8707666fed6-answer-B"><p>Blue</p></label>
        </div>
      
        <div class="poll-answer">
          <div class="poll-input-container">
            <input type="radio" name="choice" id="poll-ca0352665a474c4a94cfc8707666fed6-answer-G" value="G">
          </div>
          
          <label class="poll-answer-text" for="poll-ca0352665a474c4a94cfc8707666fed6-answer-G"><p>Green</p></label>
        </div>
      
        <div class="poll-answer">
          <div class="poll-input-container">
            <input type="radio" name="choice" id="poll-ca0352665a474c4a94cfc8707666fed6-answer-O" value="O">
          </div>
          
          <label class="poll-answer-text" for="poll-ca0352665a474c4a94cfc8707666fed6-answer-O"><p>Other</p></label>
        </div>
      
    </div>
  </fieldset>
  <input class="input-main" type="button" name="poll-submit" value="Submit" disabled="">
</form>

<div class="poll-voting-thanks
    poll-hidden">
  <span>Thank you.</span>
</div>

<div class="poll-submissions-count poll-hidden">
  
    You have used <span class="poll-current-count">{{ submissions_count }}</span> out of <span class="poll-max-submissions">{{ max_submissions }}</span> submissions.
  
</div>

@xitij2000
Copy link
Member

xitij2000 commented Jan 13, 2020

@murad-hubib @xitij2000 You code seems mostly sensible but I don't feel confident in saying so without seeing it live somewhere. Also it just seems to make the code "look" semantically more like the Poll component I see in Studio, so I don't know where these forked. Is there a sandbox with your changes?

And by the way, I don't mind looking over changes like this, but please understand that my inbox has a steady heavy flow of Github PR updates, and I may not notice when you tag me. So if I don't respond, just email me directly.

@wittjeff Thanks for having a look!
Note that this is the Poll XBlock that's available on the edx-plaform (as seen here). The edx-platform version is just one patch version behind.

I will try to set up a sandbox with this version of the component soon and will link it here when it's ready.

Copy link
Member

@xitij2000 xitij2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wittjeff Here is the sandbox for this PR:

I am giving this conditional approval based on testing on Orca which seems to work better with this.
👍

  • I tested this: tested using NVDA/Windows and Orca/Linux
  • I read through the code
  • I checked for accessibility issues (some issues with NVDA)

Copy link

@wittjeff wittjeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks like proper HTML + ARIA.

@xitij2000
Copy link
Member

Thanks @wittjeff!

@musmanmalik
Copy link
Contributor

@xitij2000 We have fixed the test that relates to this PR. But some other test is failing. Can you please check
Test failing

If this is Flake Please rebuild this.

@xitij2000
Copy link
Member

@xitij2000 We have fixed the test that relates to this PR. But some other test is failing. Can you please check
Test failing

If this is Flake Please rebuild this.

Yes, this is a flaky test ATM, we have a future task to fix this. If you're like to contribute a fix, it will be welcome. I will not block this PR for that test, and since the other tests seem to have passed, this is good to merge.

@xitij2000 xitij2000 merged commit 1081354 into open-craft:master Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants