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 warning banner for "insufficient resources" #13146

Conversation

AllanOXDi
Copy link
Member

@AllanOXDi AllanOXDi commented Mar 4, 2025

Summary

This update introduces a banner to alert coaches when they do not have enough available resources to create a quiz

References

#13109

Reviewer guidance

  • Delete some exercise from the QA channel to about 2 or 3
  • Go to coach >quiz>create new quiz.
  • Add number of questions to be 25 or any number but your resource is less.

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Mar 4, 2025
@AllanOXDi AllanOXDi marked this pull request as ready for review March 4, 2025 16:32
@AllanOXDi AllanOXDi force-pushed the Add-warning-banner-for-insufficient-resources branch from 215ddd8 to a108fe1 Compare March 5, 2025 16:37
@AllanOXDi AllanOXDi force-pushed the Add-warning-banner-for-insufficient-resources branch from a108fe1 to 13fe683 Compare March 5, 2025 16:44
@marcellamaki
Copy link
Member

@radinamatic @pcenov can this go on the QA team to-do list? 🙏

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 @AllanOXDi - overall this is looking very good, and the changes I'm requesting are small tweaks:

  1. update your "context" in the string message object
  2. do a little bit of troubleshooting on the UiAlert dismissibility and report back - we can evaluate how important it is alongside where the bug might be coming from

insufficientResources: {
message:
'There are currently only {count, number} questions across all practice resources in your library. To create a larger quiz, consider adding more resources to your library.',
context: 'Message to indicate that the license is not sufficient for the user.',
Copy link
Member

Choose a reason for hiding this comment

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

I think this context might be copied from the wrong place - can you update it?

@pcenov
Copy link
Member

pcenov commented Mar 6, 2025

Hi @AllanOXDi, the following part of #13109 is not implemented: If there is a limit in the number of available questions, we should limit the number of questions that a user can add to the number of available resources. For example, in the figma spec below, the validation on the input field should have a max value of 18 (rather than 25, the section max).

2025-03-06_16-30-49

@AllanOXDi AllanOXDi requested review from marcellamaki and pcenov March 7, 2025 12:53
},
data() {
return {
inputMaxQuestions: 18,
Copy link
Member

Choose a reason for hiding this comment

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

I think the 18 is coming from the spec in the issue, but that was just an example - this should be a dynamic value that is based on the number of available questions. So this should either be 25 (the max per section) or the addableQuestionCount - I don't think you need to have a new variable here.

@@ -36,7 +43,7 @@
<KIconButton
icon="plus"
aria-hidden="true"
:disabled="questionCount >= maxQuestions || !questionCountIsEditable"
:disabled="questionCount >= inputMaxQuestions || !questionCountIsEditable"
Copy link
Member

@marcellamaki marcellamaki Mar 11, 2025

Choose a reason for hiding this comment

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

You can see in the diff that we were previously using maxQuestions. Since it doesn't seem like inputMaxQuestions is being updated dynamically, let's continue to use that, rather than add another variable here.

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.

Thank you @AllanOXDi - looks good

@marcellamaki marcellamaki merged commit 9689d96 into learningequality:develop Mar 13, 2025
36 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.) DEV: frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants