-
Notifications
You must be signed in to change notification settings - Fork 301
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
Exam mode
: Fix an issue where the end page of exam does not scroll when the page is too small
#8916
Conversation
WalkthroughThe changes implement functionality to manage the display state of an exam's end view in the application. Key updates involve introducing a boolean flag in the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CourseOverviewComponent
participant ExamParticipationService
participant ExamParticipationCoverComponent
User ->> CourseOverviewComponent: Load Course Overview
CourseOverviewComponent ->> ExamParticipationService: Subscribe to endViewDisplayed$
ExamParticipationService -->> ExamParticipationCoverComponent: Notify end view state
ExamParticipationCoverComponent ->> ExamParticipationCoverComponent: Set boolean flag based on end view state
ExamParticipationCoverComponent -->> CourseOverviewComponent: Apply end view class if true
sequenceDiagram
participant User
participant ExamParticipationService
participant MockExamParticipationService
User ->> ExamParticipationService: setEndView(true/false)
ExamParticipationService ->> ExamParticipationService: Update examEndViewSubject
MockExamParticipationService ->> MockExamParticipationService: Simulate end view state change with examEndViewSubject
Recent review detailsConfiguration used: .coderabbit.yaml Files selected for processing (6)
Additional context usedPath-based instructions (5)
Biome
Additional comments not posted (10)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
|
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.
Actionable comments posted: 1
Outside diff range comments (5)
src/main/webapp/app/overview/course-overview.component.ts (5)
Line range hint
115-115
: Remove redundant type annotations.TypeScript's type inference means that explicit types for initialized properties are often unnecessary. Consider simplifying the code by removing these redundant type annotations.
- readonly MIN_DISPLAYED_COURSES: number = 6; + readonly MIN_DISPLAYED_COURSES = 6; - readonly WINDOW_OFFSET: number = 300; + readonly WINDOW_OFFSET = 300; - readonly ITEM_HEIGHT: number = 38; + readonly ITEM_HEIGHT = 38; - readonly BREADCRUMB_AND_NAVBAR_HEIGHT: number = 88; + readonly BREADCRUMB_AND NAVBAR_HEIGHT = 88;Also applies to: 122-122, 130-130, 131-131, 135-135
Tools
Biome
[error] 122-122: This type annotation is trivially inferred from its initialization.
Safe fix: Remove the type annotation.
(lint/style/noInferrableTypes)
Line range hint
145-145
: Avoid usingany
type for better type safety.Using
any
disables TypeScript's static type checking. Where possible, replaceany
with more specific types to enhance code robustness and maintainability.- componentRef: any + componentRef: SpecificComponentType // Replace `SpecificComponentType` with the actual expected type. - activatedComponentReference: any + activatedComponentReference: SpecificComponentType // Replace `SpecificComponentType` with the actual expected type.Also applies to: 153-153, 583-583, 599-599
Tools
Biome
[error] 122-122: This type annotation is trivially inferred from its initialization.
Safe fix: Remove the type annotation.
(lint/style/noInferrableTypes)
Line range hint
313-313
: Remove unnecessary non-null assertions.Non-null assertions override TypeScript's strict null checks and can lead to runtime errors if not used carefully. Ensure that the variables are indeed non-null or handle potential null cases gracefully.
- this.course!.exercises + this.course?.exercisesAlso applies to: 532-532, 542-542, 734-734
Tools
Biome
[error] 122-122: This type annotation is trivially inferred from its initialization.
Safe fix: Remove the type annotation.
(lint/style/noInferrableTypes)
Line range hint
720-720
: Refactor to use template literals and avoid assignments in expressions.Using template literals enhances readability and maintainability. Additionally, avoid assignments within expressions to reduce potential side-effects and improve clarity.
- '/topic/courses/' + this.courseId + '/quizExercises' + `/topic/courses/${this.courseId}/quizExercises`Also applies to: 774-774
Tools
Biome
[error] 122-122: This type annotation is trivially inferred from its initialization.
Safe fix: Remove the type annotation.
(lint/style/noInferrableTypes)
Line range hint
781-781
: Use optional chaining for safer property access.Optional chaining is a safer way to access nested properties on objects that might be
null
orundefined
. This reduces the risk of runtime errors.- if (this.route.snapshot.firstChild?.data?.pageTitle) + if (this.route.snapshot.firstChild?.data?.pageTitle?)Tools
Biome
[error] 122-122: This type annotation is trivially inferred from its initialization.
Safe fix: Remove the type annotation.
(lint/style/noInferrableTypes)
src/test/javascript/spec/helpers/mocks/service/mock-exam-participation.service.ts
Show resolved
Hide resolved
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.
Tested on TS5. The page is scrollable even with a small window 👍
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.
Tested on TS1, and works as expected. Code lgtm too
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.
I don't think it is going to be a problem because I am not sure if such a small screen is a realistic use case, but I can discuss this with @rabeatwork on Monday 👍 Since, this PR only fixing the scroll problem in end page and we don't use this footer in end page, it will not be in the scope of this PR. |
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.
Code lgtm
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.
Code LGTM and works fine on TS3 besides one unrealistic edge case
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.
maintainer approve
Exam Mode
: Fix an issue where the end page of exam does not scroll when the page is too smallExam mode
: Fix an issue where the end page of exam does not scroll when the page is too small
Checklist
General
Client
Motivation and Context
In the end page of student view of exam mode, users can not scroll down if the page gets too small.
Description
I added a scrollbar if the user is currently in the end page of an exam.
Steps for Testing
Prerequisites:
Exam Mode Testing
Prerequisites:
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Code Review
Manual Tests
Exam Mode Test
Screenshots
Summary by CodeRabbit
New Features
Style
Bug Fixes
Tests