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

LearnerSummaryPage: Fix quiz/lesson report links #13037

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

nucleogenesis
Copy link
Member

Summary

LessonSummaryPage was using the wrong page names when generating the links to the proper reports. This PR corrects them.

References

Fixes #13027

Reviewer guidance

Click the links in Coach -> Learners -> <Specific Learner Summary> for Lessons and Quizzes, they should work.

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Jan 29, 2025
@ozer550
Copy link
Member

ozer550 commented Jan 29, 2025

Hi @nucleogenesis! while testing I found this different behavior when clicking on the quiz links.
If we try to open the links in a new tab it has a different behavior then doing it on the same page.

link.mp4

@@ -174,7 +170,10 @@
return this.getLearnersForExam(quiz).includes(this.learner.id);
},
quizLink(quizId) {
return this.classRoute(PageNames.REPORTS_LEARNER_REPORT_QUIZ_PAGE_ROOT, { quizId });
return this.classRoute(PageNames.QUIZ_LEARNER_REPORT, { quizId });
},
Copy link
Member

@AllanOXDi AllanOXDi Jan 29, 2025

Choose a reason for hiding this comment

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

I think the route definitions for this page is missing the meta.titleParts. (https://github.com/learningequality/kolibri/blob/13027-broken-links-learner-summary-page/kolibri/plugins/coach/assets/src/composables/useCoreCoach.js#L46) which might explain the failed page title. So, you might needs to check the route configuration for those specific pages (QUIZ_LEARNER_REPORT and LESSON_LEARNER_REPORT) and ensure their meta fields have titleParts defined.
Screenshot 2025-01-29 at 15 11 10

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like it was caused by the appBarTitle being set specifically rather than letting it use the title parts, should be good now.

Thanks @AllanOXDi !

@nucleogenesis nucleogenesis force-pushed the 13027-broken-links-learner-summary-page branch from b64b850 to a85c025 Compare January 30, 2025 22:33
@nucleogenesis
Copy link
Member Author

I think that maybe we need to remove the GROUP_NAME from all (or at least some) of the titleParts in the report title.

This is causing the error when generating the page title - see the change in this commit where I updated the params -- basically, I'd also need to pass a groupId param to get the title to generate w/out errors.

Putting the group name in the title appears to be vestigial from the previous UX where a coach could end up on reports through the Groups UI.

Now the coach cannot get to a report in a group-specific context and users can be in multiple groups, so it seems irrelevant to the report page itself.

Thoughts @AllanOXDi @AlexVelezLl @marcellamaki ?

@AlexVelezLl
Copy link
Member

Hmmm, I would suggest just one alternative is that we can validate if the param groupId is defined here, because that param is optional, and it makes no sense that in the useCoreCoach we treat it as a required param. So even if GROUP_NAME is part of the titleParts, if params.groupId is not defined, then we can just skip it.

@@ -190,7 +186,10 @@
return this.getLearnersForExam(quiz).includes(this.learner.id);
},
quizLink(quizId) {
return this.classRoute(PageNames.REPORTS_LEARNER_REPORT_QUIZ_PAGE_ROOT, { quizId });
return this.classRoute(PageNames.QUIZ_LEARNER_REPORT, { quizId });
Copy link
Member

Choose a reason for hiding this comment

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

Here this route is failing because we are not passing the questionId, interactionIndex and tryIndex params. Here it would be better to use the QUIZ_LEARNER_PAGE_ROOT page that the only thing that it does is that it redirects it to the QUIZ_LEARNER_REPORT page but defines default values for these params, so we dont need to do it here.

@radinamatic
Copy link
Member

radinamatic commented Feb 5, 2025

Looking good, no more broken links! 👍🏽

Maybe connected to what is discussed above, I would point out that the presentation of the lesson not visible and quiz not started are visually different, that is, not consistent: clicking on the not started quiz appears as if there are no questions in it. We should at least add a string Quiz not started (we'll open a separate issue), to palliate a bit the blank page and make the quiz report more clear.

recording screenshot
https://github.com/user-attachments/assets/6db08d5a-fe08-4f9d-a8ec-696fd0ee6704 2025-02-05_05-36-09

Copy link
Member

@radinamatic radinamatic left a comment

Choose a reason for hiding this comment

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

Broken links are no more, some follow up changes to come! 👍🏽 💯 :shipit:

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.

Code wise looks good to me aswell :)

Copy link
Member

@AllanOXDi AllanOXDi left a comment

Choose a reason for hiding this comment

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

LGTM!

@nucleogenesis nucleogenesis merged commit 3e2a484 into develop Feb 6, 2025
40 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.

Broken links for assignments on learner's summary page
5 participants