Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix Coach > Quizzes blank page after copying a quiz #12941

Merged

Conversation

LianaHarris360
Copy link
Member

Summary

After creating a copy of a quiz and clicking the "All quizzes" link, an empty page was displayed with the console error message: TypeError: Cannot read properties of undefined (reading 'length').

The error occurred because assignment.assignments or assignment.learner_ids within getLearnersForAssignment() was not guaranteed to be defined.

The change in this pull request ensures that every assignment object passed into getLearnersForAssignment() has assignments and learner_ids set as empty arrays if there are no items.

CorrectQuizCopyBehavior.mov

References

Closes #12814

Reviewer guidance

  1. Navigate to to Coach > Class home, make a copy of a quiz, and select the 'All Quizzes' link.

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Dec 12, 2024
Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

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

At first I thought if it would be better to check how the data is loaded and why these variables were not coming, but during manual QA I realized that this data is loaded at a later stage, so it makes total sense to put these guards for when it is not loaded yet. Thanks Liana!

@LianaHarris360 LianaHarris360 merged commit 025d085 into learningequality:develop Dec 12, 2024
38 of 39 checks passed
# for free to join this conversation on GitHub. Already have an account? # 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.

Coach > Quizzes - Seeing a blank page after creating a copy of a quiz
2 participants