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

Finishing up the Quiz Root Page #11434

Merged

Conversation

nucleogenesis
Copy link
Member

@nucleogenesis nucleogenesis commented Oct 20, 2023

Merge learningequality/kolibri-design-system#497 before merging this

Summary

  • Adds a 'debug' tool in the useQuizCreation module that populates some basic data for quick visual testing
  • Applies styles to the main page closer to the Figma (WIP)
  • Accordion implementation should be a11y compliant (outside perhaps of some optional aria tags; required tags are implemented I believe)
  • Handles KCheckbox selection & the icons associated with the behavior (WIP)

This is based directly on the work laid out in #11382 -- commits up to the "KDS Linkage" commit are not new work in this PR and will be removed when that other PR merges to develop and this is rebased on that.

References

#11382
#11013

Reviewer guidance

TBD


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@nucleogenesis nucleogenesis changed the title Feature quizrootpolish Finishing up the Quiz Root Page Oct 20, 2023
@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) SIZE: large labels Oct 20, 2023
@radinamatic
Copy link
Member

radinamatic commented Oct 25, 2023

First of all, congrats to you and @AllanOXDi for all the work on this so far! Great progress, this is starting to look and feel almost exactly as I hoped from the designs! 👏🏽 💯

Keyboard navigation is logical and even though it will get more complex once questions and answers are in play, so far it's not overwhelming. There are just a few rough edges remaining to smooth.

Tabs for sections

Work as expected, according to our KDS component, a couple of notes:

  • As you probably noticed the error in the console, KTablist is missing the label. Since we do not have a visible label for sections, we need to use aria-label, instead of aria-labelledby which is now empty on the element with the role="tablist". I suggest a simple 'Quiz sections'.

  • I'm guessing the 'A' in the tab title is an oversight? It's not there in the newly created sections (which I noticed are still under development, so not going to comment on pending items):

    2023-10-25_3-29-43
  • Pay attention on where you return the focus after a section is deleted, it should go to the next tab in the sequence if there is one, otherwise on the preceding one. See more details on the ARIA authoring practices for tab pattern. We did not have that option on the rest of the tabs on Coach page, so not sure if it's implemented in KDS.

Accordion for questions

A bit more polishing needed here. First of all the missing labels:

  • for 'Replace' and 'Delete' icons just reuse the tooltip
  • for selecting and moving the questions I was initially thinking of inserting the questions title, but that might be too verbose. So maybe just 'Select' and 'Move up'/'Move down' could suffice (the current 'up' and 'down' is a bit bare).

Now the interaction:

  • The recommended practice is to have a button element inside the accordion header, not a link. Would that be possible?

  • There's no need to have the chevron as a separate link, it could be a part of the button inside the accordion header just as a visual element. See more details on the example of ARIA authoring practices for the accordion pattern. This way we eliminate one unnecessary Tab click from the sequence that is already long and complex.

  • There may have been a mixup here, the question title (accordion header) needs to be the H element, not the content of the accordion panel:

    2023-10-25_4-07-57

    As for the heading level needed here, it seems the most logical to me for the page title 'Create new quiz' to be the H1, each 'Section 1/2/3...' in the tabs should be the H2, and each question title in the accordion header should be the H3.

  • Even though the accordion is keyboard navigable and would be usable for the sighted user, what worries me the most is that I don't see required attributes aria-expanded and aria-controls that are required for this pattern to be accessible to screen reader users. See more details on the ARIA authoring practices for the accordion pattern, as well as on the example linked above.

Again, great job so far, we're almost there! 🙂

nucleogenesis added a commit that referenced this pull request Oct 25, 2023
…bs-with-overflow

Merging this to mitigate rebase issues; @LianaHarris360 ' review notes will be handled in #11434 which is based on this PR
@nucleogenesis nucleogenesis marked this pull request as ready for review October 26, 2023 05:15
@nucleogenesis nucleogenesis force-pushed the feature--quizrootpolish branch 2 times, most recently from e5b805c to ebc7ac5 Compare October 31, 2023 15:52
@AllanOXDi AllanOXDi mentioned this pull request Nov 3, 2023
9 tasks
@nucleogenesis
Copy link
Member Author

Tests will be fixed with rebase on develop after merging #11535

@nucleogenesis nucleogenesis marked this pull request as draft November 28, 2023 23:01
@nucleogenesis nucleogenesis marked this pull request as ready for review November 29, 2023 20:02
Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

Thanks @nucleogenesis. Following our live review, I have just two comments. One is non-blocking but a response/little discussion would be great just to have a reference for it in github somewhere. the other is a very tiny cleanup request. Overall I think it will be okay to merge and build on top of this. Thanks for all the work here

@@ -64,6 +99,7 @@ export default () => {
* @throws {TypeError} if section is not a valid QuizSection
**/
function updateSection({ section_id, ...updates }) {
console.log('updating with...', section_id, updates);
Copy link
Member

Choose a reason for hiding this comment

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

very small but can you either get rid of this or add a TODO to cleanup console logs later?

@@ -2,6 +2,9 @@

<div>
<h1>Replace questions</h1>
<p v-for="(question,index) in quizForge.selectedActiveQuestions.value" :key="`${index}q`">
{{ JSON.stringify(question) }}
Copy link
Member

Choose a reason for hiding this comment

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

not blocking: the JSON.stringify(question) here feels very weird. is there something about the data structure that requires this, whereas in other places we don't need it? Is it permanent or is this because of the debugging setup? I know that we do use JSON.stringify in places but I am struggling to think of other instances where we use it in a vue template.

Copy link
Member Author

Choose a reason for hiding this comment

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

This will be wiped out in #11497 -- I just put it there as an example of like... "look here is where/how you get the questions"

@marcellamaki marcellamaki merged commit 1ef0b57 into learningequality:develop Dec 1, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) SIZE: large
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants