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

Add quiz recipients selector as Side Panel #12952

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

AlexVelezLl
Copy link
Member

@AlexVelezLl AlexVelezLl commented Dec 16, 2024

Summary

Add quiz recipients selector as Side Panel.

Compartir.pantalla.-.2024-12-17.10_59_21.mp4

References

Closes #12901.

Reviewer guidance

  • Create a new quiz and assign an entire class, groups or students.
  • Edit a created quiz and assig an entire class, groups or students.
  • Check error statuses.

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Dec 16, 2024
@AlexVelezLl AlexVelezLl marked this pull request as ready for review December 17, 2024 15:54
@@ -0,0 +1,130 @@
<template>
Copy link
Member Author

@AlexVelezLl AlexVelezLl Dec 17, 2024

Choose a reason for hiding this comment

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

This is just a refactor to break down the current IndividualLearnerSelector component to have an IndividualLearnerSelectorTable that we can reuse in the LearnersSelectorSidePanel. I havent edited the logic of this component, just extracted the table.

{{ $tr('selectGroupsAndIndividualLearnersTitle') }}
</h1>
</template>
<div style="padding-top: 30px">
Copy link
Member Author

Choose a reason for hiding this comment

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

Once #12895 is merged we will need to remove this div, as its adding a fixing-padding that wont be needed after #12895

display: flex;
justify-content: flex-end;
width: 100%;
margin-bottom: 16px;
Copy link
Member Author

Choose a reason for hiding this comment

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

Once #12895 is merged we will need to remove this maring, as its adding a fixing-marging that wont be needed after #12895

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.

Overall this looks really good @AlexVelezLl - I don't think I'll have time to do a second pass today (so it will be merged after the new year) but on initial read through overall the code changes make sense to me. I'd love for @pcenov to do some more robust QA especially since he is so good at finding those edge cases. If you can get to it tomorrow (Friday 20th) Peter, great, but no problem if it's not til after the holidays as well.

One small UI note - I'm not sure if this may be resolved after we merge your resource selection and sidepanel refactors PR, but the page content for a long learner list is cut off. All of the learners are visible, but because the pagination is covered by the bottom bar, it looks as if something might be "missing" (and presumably, if there were enough learners to paginate, this would prevent the user from being able to). If this will be fixed after rebasing that other PR, please disregard!

Screenshot 2024-12-19 at 12 58 54 PM after deleting the bottom bar element in the browser: Screenshot 2024-12-19 at 1 59 07 PM

@@ -11,6 +11,10 @@
{{ submitErrorMessage }}
</UiAlert>

<!--
TODO: Refactor or rename this component, setting a title or a description
is not part of an "assignment" process (?)
Copy link
Member

Choose a reason for hiding this comment

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

Yes, I think calling it something more like "QuizTitleAndRecipientsHeader" would make more sense even if it's longer

@pageChanged="currentPageLearners = $event.items"
>
<template #default="{ items }">
<CoreTable
Copy link
Member

Choose a reason for hiding this comment

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

This is absolutely not required and not blocking, but just a thought, @AlexVelezLl - do you think that using the new KTable here would be difficult to refactor in? If it's going to add lots of work, we don't have to. I just wonder if there might be any a11y benefits and this is a moment when we could refactor it in "in the course of" rather than in separate work as tech debt tasks.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe you could spend 30-60 minutes and see how it goes? If it seems like it would take a lot longer and introduce complexities, we don't have to do it now. If it seems like something you could do in a few hours, perhaps worth it (especially as the next couple of weeks will be quite)

Copy link
Member Author

Choose a reason for hiding this comment

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

For sure! I can give it a try and see how it goes :).

{
label: this.$tr('copyQuizAction'),
value: 'COPY',
},
{ label: this.coreString('deleteAction'), value: 'DELETE' },
];
if (!this.exam?.archive) {
Copy link
Member

Choose a reason for hiding this comment

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

Is this just because the archive key would exist so we can use that instead of the draft prop? If so, how is that distinct from this.exam?.draft that we are using below for the label condition?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh no, there are three different "states". exam in draft, exam "active"(once the exam is published) and exam closed. The this.exam?.archive represents that the exam was closed. So when the exam is "not archived", it can be either in draft or not.

@AlexVelezLl
Copy link
Member Author

AlexVelezLl commented Dec 19, 2024

Thanks @marcellamaki. Yes! The issue with the hidden pagination buttons will be fixed once #12895 is merged too :).

@AlexVelezLl AlexVelezLl force-pushed the quiz-assignment-side-panel branch from bb801dd to ef6d377 Compare December 19, 2024 20:24
@pcenov
Copy link
Member

pcenov commented Dec 20, 2024

Hi @AlexVelezLl and @marcellamaki, just some comments/points for discussion:

  1. Why are we introducing the "All Ungrouped Learners" label? Previously we had "Individual learners" and it's still in use in Coach > Lessons. If we decide to use the new label, then the capitalization should be corrected, so that it's changed to "All ungrouped learners", but also we will have to use the same label at Coach > Lessons for consistency.

2024-12-20_14-14-40

  1. With the current implementation of the "All ungrouped learners" checkbox it's duplicating the function of the "Select all on page" checkbox in the '"Individual learners table. Previously selecting the "Individual learners" button resulted in actually showing the "Individual learners" table while now it's constantly shown. So again the question is - will that be implemented in the same way in Coach > Lessons and is that the correct implementation?
select.all.mp4

Also when there aren't any learners yet the checkbox "All ungrouped learners" is selected by default and cannot be deselected:

selected by default

  1. Introducing validation here is also a bit problematic, because currently I can create and assign a quiz to the entire class when there's not a single learner enrolled in that class, I can also assign the quiz to an empty group but if I select the "Groups and individual learners" radio button and don't select learners then I am seeing the validation. It even let's me "save" the side panel selection without any users selected:
validation.mp4

@pcenov
Copy link
Member

pcenov commented Dec 20, 2024

Also we probably should have the same implementation when copying a quiz, as currently it's not changed there:

copy.quiz.mp4

@marcellamaki
Copy link
Member

Thank you @pcenov - this is all very helpful. The reason for this change was some feedback that we've gotten from the community that @jtamiace created a new design for. I'll chat review your notes with her and make sure that we're addressing the implementation in all of the places that we need, and will also look through the issues/concerns with the validation (and discuss with @AlexVelezLl to figure out the exact criteria we need). Happy new year :)

@pcenov
Copy link
Member

pcenov commented Jan 6, 2025

Happy new year @marcellamaki! Looking back at my comments I guess the 2024 version of me was just mildly surprised to see the change, but it's a welcome change! :)

@AlexVelezLl
Copy link
Member Author

With the current implementation of the "All ungrouped learners" checkbox it's duplicating the function of the "Select all on page" checkbox in the '"Individual learners table.

Its not always the same, "All ungrouped learners" refers to all learners that dont belong to any group, so checking and unchecking this will check and uncheck just the learners that dont belong to any group, so:

  1. It wont select/deselect learners that belong to a group.
  2. It will select/deselect all ungrouped learners from all table pages, not just the ones we see in the current page.

While "select all on page" will select/deselect all "selectable" learners (bear in mind that learners that has been selected through group selection are disabled and will not be affected by this) whether they are in a group or not, but will just affect the learners that are in the current page.

Also when there aren't any learners yet the checkbox "All ungrouped learners" is selected by default and cannot be deselected:

I havent thought about this 😅, I think we shouldnt even have the radio button if we dont have learners right? @marcellamaki and just always create the quiz in the scope of the whole class.

@marcellamaki
Copy link
Member

I think we shouldnt even have the radio button if we dont have learners right? @marcellamaki and just always create the quiz in the scope of the whole class.

Yes, that sounds like a good idea, and it's close to how it currently works in 0.17 (where you can create a quiz assigned to "entire class" if the class has no learners enrolled).

@pageChanged="currentPageLearners = $event.items"
>
<template #default="{ items }">
<KTable
Copy link
Member

Choose a reason for hiding this comment

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

🎉

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.

Hi @AlexVelezLl - thank you for the updates to use KTable! Overall, I think this is looking good. I never do quite as complete of QA as Peter does, of course, but from my perspective, the code changes look good and I only found one small area of improvement with the manual QA.

I noticed that the validation error banner doesn't dismiss after the error is resolved when testing quiz assignment. i.e.

Screen.Recording.2025-01-09.at.2.28.45.PM.mov

Even though this banner can be manually dismissed, I think having it auto dismiss on resolve would be helpful for the user.

@AlexVelezLl
Copy link
Member Author

Thanks @marcellamaki! I have pushed the changes revalidating the form on change, and removing the select groups and learners radio button if there are no learners in the class.

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.) DEV: frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update quiz assignment workflow to use side panel UI
3 participants