-
Notifications
You must be signed in to change notification settings - Fork 108
[MBL-19568][Student] Fix folder bookmarking and quiz routing #3430
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -403,6 +403,13 @@ object RouteMatcher : BaseRouteMatcher() { | |
| AssignmentDetailsFragment::class.java | ||
| ) | ||
| ) | ||
| routes.add( | ||
| Route( | ||
| courseOrGroup("/:${RouterParams.COURSE_ID}/assignments/:${RouterParams.ASSIGNMENT_ID}"), | ||
| QuizListFragment::class.java, | ||
| AssignmentDetailsFragment::class.java | ||
| ) | ||
| ) // Route for new quizzes opened from the quiz list. New quizzes are shown on the Assignment details. This is needed for the bookmarker to find the correct route. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate route pattern: This new route uses the same URL pattern as the route added just above it (lines 401-405):
Both routes point to Questions:
The comment explains the intent, but the implementation might cause routing ambiguity. |
||
|
|
||
| // Studio | ||
| routes.add( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential NPE concern: The expression
folder?.isRoot == trueuses safe navigation, but consider what happens iffolderis null. Whenfolderis null,folder?.isRootevaluates tonull, andnull == trueevaluates tofalse. This means the bookmark will not be enabled for null folders.Is this the intended behavior? If
folderbeing null should also disable bookmarking, this is correct. However, if there are scenarios wherefoldercould be null but bookmarking should still be allowed (e.g., at the root level before folder is initialized), this might cause issues.Consider adding a comment explaining the expected behavior when
folderis null.