-
Notifications
You must be signed in to change notification settings - Fork 297
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
Programming exercises
: Add feedback discussion feature to feedback analysis table
#9810
Programming exercises
: Add feedback discussion feature to feedback analysis table
#9810
Conversation
…g-exercises/add-affected-students-to-analysis-table
…d-students-to-analysis-table
…d-affected-students-to-analysis-table' into feature/programming-exercises/add-affected-students-to-analysis-table
…d-students-to-analysis-table
…d-affected-students-to-analysis-table' into feature/programming-exercises/add-affected-students-to-analysis-table
…g-exercises/add-communication-feature-to-analysis-table # Conflicts: # src/main/java/de/tum/cit/aet/artemis/assessment/web/ResultResource.java # src/main/java/de/tum/cit/aet/artemis/exercise/repository/StudentParticipationRepository.java # src/main/webapp/app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.component.html # src/main/webapp/app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.component.ts # src/main/webapp/app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.service.ts # src/main/webapp/i18n/de/programmingExercise.json # src/main/webapp/i18n/en/programmingExercise.json
…g-exercises/add-communication-feature-to-analysis-table
|
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.
Re-approve code
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
🧹 Outside diff range and nitpick comments (3)
src/main/webapp/app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.component.ts (3)
215-218
: Consider using a dedicated interface for the request DTO.The
FeedbackChannelRequestDTO
could be better structured by defining its properties in a dedicated interface rather than creating it inline.- const feedbackChannelRequest: FeedbackChannelRequestDTO = { - channel: channelDto, - feedbackDetailText: feedbackDetail.detailText, - }; + const feedbackChannelRequest = FeedbackChannelRequestDTO.create({ + channel: channelDto, + feedbackDetailText: feedbackDetail.detailText, + });
220-227
: Add a delay before navigation to ensure visibility of success message.The immediate navigation might prevent users from seeing the success message. Consider adding a small delay.
- if (navigate) { - const urlTree = this.router.createUrlTree(['courses', this.courseId(), 'communication'], { - queryParams: { conversationId: createdChannel.id }, - }); - await this.router.navigateByUrl(urlTree); - } + if (navigate) { + // Allow time for success message to be shown + await new Promise(resolve => setTimeout(resolve, 1500)); + const urlTree = this.router.createUrlTree(['courses', this.courseId(), 'communication'], { + queryParams: { conversationId: createdChannel.id }, + }); + await this.router.navigateByUrl(urlTree); + }
234-236
: Document the empty catch block.While it's valid to ignore modal dismissal, it's good practice to document this intention.
} catch { - // modal dismissed + // Intentionally empty: modal dismissal is an expected user action } finally {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
src/main/webapp/app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.component.ts
(7 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/webapp/app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.component.ts (1)
🔇 Additional comments (3)
src/main/webapp/app/exercises/programming/manage/grading/feedback-analysis/feedback-analysis.component.ts (3)
2-2
: LGTM! Clean implementation of new imports and properties.
The new imports and properties are well-organized and follow Angular's style guide. The modal state management flag is a good practice to prevent multiple instances.
Also applies to: 5-6, 15-17, 30-31, 71-72
228-230
: 🛠️ Refactor suggestion
Enhance error handling with specific error messages.
The current error handling could be more specific to provide better user feedback.
205-239
: Verify potential sensitive information leakage.
Based on the PR objectives, there were concerns about sensitive information being exposed through channel names. Ensure that the channel creation process includes appropriate warnings or validations.
✅ Verification successful
Let me search for channel-related validation and warnings in the codebase.
Let me search for channel name validation in the feedback channel creation modal.
Based on the search results, I can now provide a final response:
Channel name validation is properly implemented with appropriate restrictions.
The codebase includes several safeguards for channel names:
- Channel names must match the regex pattern
^[a-z0-9-]{1}[a-z0-9-]{0,30}$
, which only allows lowercase letters, numbers, and hyphens - Maximum length is enforced to 20 characters
- Channel names are required and cannot be empty
- Channel creation form includes validation with appropriate error messages
- Channel names are automatically formatted to remove special characters and convert to lowercase
The implementation in channel-form.component.ts
and its usage in the feedback channel creation modal provides sufficient protection against sensitive information being exposed through channel names.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for potential sensitive information handling in channel-related code
# Look for any existing warning messages or validation
rg -l "warning|sensitive|private" --type ts
# Check for test case visibility handling
ast-grep --pattern 'visibility === "NEVER" || visibility === "AFTER_DUE_DATE"'
Length of output: 94414
Script:
#!/bin/bash
# Search for channel creation validation and warnings in relevant files
rg -A 5 "createChannel|channelDto|FeedbackDetailChannelModal" --type ts
# Search for any warning messages in channel creation
rg -A 5 "warning.*channel|channel.*warning" --type ts
# Look for channel name validation
rg -A 5 "channel.*name.*validation|validateChannel|channelName" --type ts
Length of output: 102741
Script:
#!/bin/bash
# Look for channel name validation in feedback channel modal
rg -A 10 "FeedbackDetailChannelModal" --type ts
# Look for channel name validation patterns
rg -A 5 "channelRegex|channel.*pattern|channel.*validation" --type ts
Length of output: 28406
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.
re-approve
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.
- The code looks good
- I tested the PR on TS1, where I created an exercise, throwing a custom error message. Subsequently, I made a channel on the Feedback Analysis page to address this error message
- The aforementioned incorrect message does not appear anymore.
…cation-feature-to-analysis-table
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
🧹 Outside diff range and nitpick comments (2)
src/main/java/de/tum/cit/aet/artemis/exercise/repository/StudentParticipationRepository.java (2)
1391-1412
: Consider adding parameter validation.The implementation is well-optimized with INNER JOINs and properly filters for the latest results. However, consider adding
@NotNull
annotations for the parameters to ensure they are validated at compile time.- List<String> findAffectedLoginsByFeedbackDetailText(@Param("exerciseId") long exerciseId, @Param("detailText") String detailText); + List<String> findAffectedLoginsByFeedbackDetailText(@Param("exerciseId") @NotNull long exerciseId, @Param("detailText") @NotNull String detailText);
1414-1439
: Consider adding parameter validation.The implementation is well-optimized and consistent with
findAffectedLoginsByFeedbackDetailText
. Consider adding@NotNull
annotations for the parameters to ensure they are validated at compile time.- long countAffectedStudentsByFeedbackDetailText(@Param("exerciseId") long exerciseId, @Param("detailText") String detailText); + long countAffectedStudentsByFeedbackDetailText(@Param("exerciseId") @NotNull long exerciseId, @Param("detailText") @NotNull String detailText);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
src/main/java/de/tum/cit/aet/artemis/exercise/repository/StudentParticipationRepository.java
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/java/de/tum/cit/aet/artemis/exercise/repository/StudentParticipationRepository.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_imports
Checklist
General
Server
Client
authorities
to all new routes and checked the course groups for displaying navigation elements (links, buttons).Motivation and Context
This is a follow-up to the feature I’m working on: #9728. The goal is to provide instructors with clearer insights into the feedback given to students. In this PR, a “Feedback Discussion” modal has been introduced. This feature allows instructors to select specific feedback and open a communication channel for it, provided the course has one. For example, during an exam review, instructors can use this functionality to send messages that clarify certain mistakes, offering students a better understanding and clearer insights.
Description
A new server-side query has been implemented, which takes a feedbackDetailText input and creates a channel based on it, automatically adding all students who encountered the corresponding error. On the client side, instructors can now create these channels via a modal accessible on the far-right side of each feedback entry. This modal provides two options: instructors can either navigate directly to the newly created channel or remain on the feedback analysis page. Additionally, the modal allows instructors to specify the channel type, name, and description.
Steps for 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
Performance Review
Code Review
Manual Tests
Performance Tests
Test Coverage
Screenshots
Before:
After:
Summary by CodeRabbit
Release Notes
New Features
Enhancements
Bug Fixes
Documentation