-
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 group feedback feature to feedback analysis table
#9884
base: develop
Are you sure you want to change the base?
Programming exercises
: Add group feedback feature to feedback analysis table
#9884
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.
Actionable comments posted: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.java
(7 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.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
📓 Learnings (1)
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.java (2)
Learnt from: julian-christl
PR: ls1intum/Artemis#9322
File: src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseStudentParticipationRepository.java:0-0
Timestamp: 2024-11-12T12:51:51.201Z
Learning: In Artemis, an `ExerciseGroup` always has an associated `Exam`, so `exerciseGroup.exam` is never null.
Learnt from: julian-christl
PR: ls1intum/Artemis#9322
File: src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseStudentParticipationRepository.java:170-172
Timestamp: 2024-11-12T12:51:46.554Z
Learning: In Artemis, `exercise.exerciseGroup` may be null, as not all exercises belong to an `ExerciseGroup`.
🔇 Additional comments (4)
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.java (4)
10-10
: LGTM: Import statements are appropriate.
The added imports are necessary for implementing the new Levenshtein grouping functionality.
Also applies to: 29-29, 53-53, 69-69
744-752
: LGTM: Method refactor improves code clarity.
The change from using feedbackId to detailText and testCaseName parameters is well-implemented and aligns with the PR objectives.
694-695
:
Add null check before accessing first element of detailText list.
Calling getFirst() without checking if the list is empty could throw NoSuchElementException.
Apply this diff:
-aggregatedTexts.add(base.detailText().getFirst());
+if (!base.detailText().isEmpty()) {
+ aggregatedTexts.add(base.detailText().getFirst());
+}
Likely invalid or redundant comment.
629-632
:
Fix potential NullPointerException in levenshtein comparison.
The current implementation could throw NPE if levenshtein is null.
Apply this diff:
-if (!Boolean.parseBoolean(levenshtein)) {
+if (!enableLevenshteinGrouping) {
Likely invalid or redundant comment.
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.java
Outdated
Show resolved
Hide resolved
…g-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.
Code lgtm to me now, with the improved aggregation algorithm
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: CHILL
📒 Files selected for processing (1)
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.java
(6 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.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
📓 Learnings (1)
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.java (2)
Learnt from: julian-christl
PR: ls1intum/Artemis#9322
File: src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseStudentParticipationRepository.java:0-0
Timestamp: 2024-11-12T12:51:51.201Z
Learning: In Artemis, an `ExerciseGroup` always has an associated `Exam`, so `exerciseGroup.exam` is never null.
Learnt from: julian-christl
PR: ls1intum/Artemis#9322
File: src/main/java/de/tum/cit/aet/artemis/programming/repository/ProgrammingExerciseStudentParticipationRepository.java:170-172
Timestamp: 2024-11-12T12:51:46.554Z
Learning: In Artemis, `exercise.exerciseGroup` may be null, as not all exercises belong to an `ExerciseGroup`.
🔇 Additional comments (4)
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.java (4)
744-752
: LGTM! Method signature changes align with feedback grouping feature.
The changes to use detailText
list and testCaseName
instead of feedbackIds
are well-documented and properly implemented.
673-675
:
Add null check for detailText list access.
Accessing detailText.getFirst()
without checking if the list is empty could cause NoSuchElementException.
Apply this diff:
- Comparator.comparing(detail -> detail.detailText().isEmpty() ? "" : detail.detailText().getFirst(), // Sort by the first element of the list
+ Comparator.comparing(detail -> detail.detailText().stream().findFirst().orElse(""), // Safely get first element
Likely invalid or redundant comment.
575-580
:
Convert levenshtein
parameter to boolean type.
The levenshtein
parameter is used as a boolean flag but declared as String. This is error-prone and less type-safe.
Apply this diff to improve type safety:
-public FeedbackAnalysisResponseDTO getFeedbackDetailsOnPage(long exerciseId, FeedbackPageableDTO data, String levenshtein) {
+public FeedbackAnalysisResponseDTO getFeedbackDetailsOnPage(long exerciseId, FeedbackPageableDTO data, boolean enableLevenshteinGrouping) {
Likely invalid or redundant comment.
628-631
:
Use safer boolean comparison and consider string constant.
The string comparison for levenshtein parameter is error-prone and could lead to NullPointerException.
Apply this diff to fix the comparison:
-if (!Boolean.parseBoolean(levenshtein)) {
+if (!enableLevenshteinGrouping) {
Likely invalid or redundant comment.
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.java
Show resolved
Hide resolved
src/main/java/de/tum/cit/aet/artemis/assessment/service/ResultService.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.
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.
Tested on TS2, grouping works just fine.
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 TS2]
Works as described!
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.
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: #9810. The goal is to provide instructors with clearer insights into the feedback given to students. In this PR, a “Group Feedback” feature has been introduced. This feature allows instructors to group similar feedback (similarity > 90%), ensuring that the table remains manageable without an overwhelming number of individual entries. This is particularly useful in scenarios where test cases utilize random values, leading to feedback that differs only slightly (e.g., by numbers) while the rest of the content remains identical.
Description
A new toggle was added along with a corresponding flag to indicate whether Levenshtein grouping should be applied. Depending on the toggle’s state (true or false), the server now either groups the feedback using Levenshtein or skips the grouping. Unfortunately, Levenshtein grouping is resource-intensive, which is why a loading indicator was added to enhance user experience during the processing.
Additionally, since Levenshtein grouping cannot be applied directly within a query, manual pagination is required when the toggle is activated.
The Affected Students Modal was also refactored. It no longer relies on feedback IDs but instead uses the feedback detail text. This approach was previously tested in the last PR with feedback channel creation, where a similar change was made, and it proved to be more efficient than working with IDs.
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
(will be updated after developer reviews!)
Screenshots
Before:
After:
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation
Tests