-
Notifications
You must be signed in to change notification settings - Fork 303
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
Modeling exercises
: Fix manual feedback results not being shown
#10132
Modeling exercises
: Fix manual feedback results not being shown
#10132
Conversation
Chore
: Modeling exercises - fix manual feedback results not being shownModeling exercises
: Fix manual feedback results not being shown
WalkthroughThe pull request introduces changes to the feedback retrieval mechanism across multiple files. The primary modification involves renaming the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Finishing Touches
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: 0
🧹 Nitpick comments (2)
src/test/javascript/spec/component/utils/result.utils.spec.ts (1)
34-43
: Test case updated to cover both manual and automatic unreferenced feedback.The test case has been appropriately modified to verify that both
AUTOMATIC
andMANUAL_UNREFERENCED
feedback types are included in the results when they have no references.However, consider adding edge cases to make the test more robust:
const feedbacks = [ { reference: 'foo' }, { reference: 'foo', type: FeedbackType.AUTOMATIC }, { type: FeedbackType.AUTOMATIC }, { type: FeedbackType.MANUAL_UNREFERENCED }, {}, + { type: FeedbackType.AUTOMATIC, reference: null }, + { type: FeedbackType.MANUAL_UNREFERENCED, reference: undefined }, + { type: FeedbackType.MANUAL, reference: undefined }, ];src/main/webapp/app/exercises/shared/result/result.utils.ts (1)
128-137
: LGTM! Well-documented and type-safe implementation.The implementation correctly handles both
MANUAL_UNREFERENCED
andAUTOMATIC
feedback types, with proper TypeScript type safety and clear documentation.Consider a minor optimization for better readability:
export const getUnreferencedFeedback = (feedbacks: Feedback[] | undefined): Feedback[] | undefined => { - return feedbacks - ? feedbacks.filter( - (feedbackElement) => !feedbackElement.reference && (feedbackElement.type === FeedbackType.MANUAL_UNREFERENCED || feedbackElement.type === FeedbackType.AUTOMATIC), - ) - : undefined; + return feedbacks?.filter( + (feedbackElement) => + !feedbackElement.reference && + (feedbackElement.type === FeedbackType.MANUAL_UNREFERENCED || feedbackElement.type === FeedbackType.AUTOMATIC), + ); };
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/main/webapp/app/exercises/modeling/participate/modeling-submission.component.ts
(2 hunks)src/main/webapp/app/exercises/shared/result/result.utils.ts
(1 hunks)src/test/javascript/spec/component/utils/result.utils.spec.ts
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/main/webapp/app/exercises/shared/result/result.utils.ts (1)
src/test/javascript/spec/component/utils/result.utils.spec.ts (1)
Pattern src/test/javascript/spec/**/*.ts
: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}
src/main/webapp/app/exercises/modeling/participate/modeling-submission.component.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (2)
src/test/javascript/spec/component/utils/result.utils.spec.ts (1)
7-7
: LGTM! Import statement updated correctly.The import statement has been updated to use
getUnreferencedFeedback
instead ofgetAutomaticUnreferencedFeedback
, aligning with the changes in the implementation.src/main/webapp/app/exercises/modeling/participate/modeling-submission.component.ts (1)
667-667
: LGTM! Getter updated to use the new function.The
unreferencedFeedback
getter has been correctly updated to usegetUnreferencedFeedback
instead ofgetAutomaticUnreferencedFeedback
.
Checklist
General
Client
Motivation and Context
For modeling exercises, the results don't show manual unreferenced feedback.
Description
This PR fixes the issue by returning both automatic and manual unreferenced feedbacks for modeling exercise results.
Steps for Testing
Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Review Progress
Code Review
Summary by CodeRabbit
New Features
Refactor
getAutomaticUnreferencedFeedback
togetUnreferencedFeedback
across multiple components