-
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
Development
: Fix wrong result subscription for exam exercises
#9453
Conversation
WalkthroughThe changes in this pull request primarily involve modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
📒 Files selected for processing (4)
- src/main/java/de/tum/cit/aet/artemis/core/config/websocket/WebsocketConfiguration.java (1 hunks)
- src/main/webapp/app/exam/participate/summary/exam-result-summary.component.html (1 hunks)
- src/main/webapp/app/exam/participate/summary/exercises/programming-exam-summary/programming-exam-summary.component.html (1 hunks)
- src/main/webapp/app/exam/participate/summary/exercises/programming-exam-summary/programming-exam-summary.component.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
src/main/java/de/tum/cit/aet/artemis/core/config/websocket/WebsocketConfiguration.java (1)
Pattern
src/main/java/**/*.java
: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_importssrc/main/webapp/app/exam/participate/summary/exam-result-summary.component.html (1)
Pattern
src/main/webapp/**/*.html
: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.src/main/webapp/app/exam/participate/summary/exercises/programming-exam-summary/programming-exam-summary.component.html (1)
Pattern
src/main/webapp/**/*.html
: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.src/main/webapp/app/exam/participate/summary/exercises/programming-exam-summary/programming-exam-summary.component.ts (1)
🔇 Additional comments (4)
src/main/webapp/app/exam/participate/summary/exercises/programming-exam-summary/programming-exam-summary.component.html (2)
51-51
: LGTM: New input property enhances view differentiationThe addition of
[personalParticipation]="!instructorView"
to thejhi-programming-exercise-instructions
component is a good enhancement. This change allows the component to differentiate between instructor and student views, which aligns with the PR objective of fixing the wrong result subscription for exam exercises.
Line range hint
1-58
: Excellent use of new Angular syntaxThe template consistently uses the new Angular syntax (@if) throughout the file, adhering to the provided coding guidelines. There are no instances of the deprecated *ngIf or *ngFor syntax, which is commendable.
src/main/webapp/app/exam/participate/summary/exercises/programming-exam-summary/programming-exam-summary.component.ts (1)
42-43
: 🧹 Nitpick (assertive)LGTM! Consider adding a comment for clarity.
The new
instructorView
input property is well-implemented and aligns with the coding guidelines. It uses camelCase, is properly decorated with@Input()
, and has an appropriate default value.This addition supports the PR objective by allowing differentiation between instructor and student views, which could be crucial for fixing the result subscription issue.
Consider adding a brief comment explaining the purpose and usage of this property, for example:
/** Determines if the component should render in instructor view mode. */ @Input() instructorView?: boolean = false;To ensure this property is utilized, let's check for its usage:
If no results are found, consider implementing the logic that utilizes this new property.
✅ Verification successful
Verification Successful
The
instructorView
input property is correctly utilized within the component's template to control thepersonalParticipation
binding. There is no need for additional logic in the TypeScript file.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for usage of instructorView in component logic and template echo "Searching for instructorView usage in component file:" rg "this\.instructorView" src/main/webapp/app/exam/participate/summary/exercises/programming-exam-summary/programming-exam-summary.component.ts echo "\nSearching for instructorView usage in component template:" rg "instructorView" src/main/webapp/app/exam/participate/summary/exercises/programming-exam-summary/programming-exam-summary.component.htmlLength of output: 689
src/main/webapp/app/exam/participate/summary/exam-result-summary.component.html (1)
Line range hint
1-208
: Excellent use of new Angular control flow syntax!The template consistently uses the new Angular control flow syntax (
@if
and@for
) throughout the file, adhering to the provided coding guidelines. This modern approach enhances readability and aligns with best practices.
src/main/webapp/app/exam/participate/summary/exam-result-summary.component.html
Show resolved
Hide resolved
src/main/java/de/tum/cit/aet/artemis/core/config/websocket/WebsocketConfiguration.java
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.
Code
...participate/summary/exercises/programming-exam-summary/programming-exam-summary.component.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.
changes lgtm
Checklist
General
Client
Motivation and Context
We noticed some log messages saying:
This PR fixes the cause of these warnings.
Description
When opening the exam summary page, a subscription to result updates is initiated. The client incorrectly used the non-personal topic instead of the personal topic. This is now fixed.
Steps for Testing
You can best test this locally or on a test server with access to the logs.
As a student, view your exams results summary. Then check the server and make sure none of the warnings as above are present.
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
Performance Review
Code Review
Manual Tests
Performance Tests
Test Coverage
Summary by CodeRabbit
New Features
instructorView
property to enhance the exam result summary display for instructors.personalParticipation
property to better manage participation visibility based on the instructor view.Bug Fixes
Documentation