Artemis
Artemis copied to clipboard
`Athena`: Allow feedback suggestion module selection on exercise level
[!WARNING] This PR includes a migration! Do not deploy to a normal test server. Instead, deploy to https://ma-schwind.ase.cit.tum.de
Checklist
General
- [x] I tested all changes and their related features with all corresponding user types on a test server.
- [x] Language: I followed the guidelines for inclusive, diversity-sensitive, and appreciative language.
- [x] I chose a title conforming to the naming conventions for pull requests.
Server
- [x] Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
- [x] I followed the coding and design guidelines.
- [x] I added multiple integration tests (Spring) related to the features (with a high test coverage).
- [x] I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
- [x] I documented the Java code using JavaDoc style.
Client
- [x] Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
- [x] I followed the coding and design guidelines.
- [x] I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
- [x] I documented the TypeScript code using JSDoc style.
- [x] I added multiple screenshots/screencasts of my UI changes.
- [x] I translated all newly inserted strings into English and German.
Motivation and Context
Currently, the used modules for the feedback selection (Athena) are set in the application's config file. This is very limiting as instructors can not select their desired Athena module individually for each exercise of their course.
Description
This PR allows instructors to select an individual Athena module for each text/programming exercise (Athena currently only supports these two exercise types):
- It fetches all available feedback suggestion modules directly from Athena
- Admins can specify restricted Athena modules via the configuration files. These restricted modules are only available for a course in case the access is explicitly granted on the course settings page (only visible for admins).
- In case a course does not has access to the restricted modules, they get filtered out from the list retrieved in step 1.
- New endpoints are added to retrieve the (filtered) module lists (each for every exercise type).
- The client displays a new dropdown menu allowing instructors to select one of the modules.
- Checks are added to the create/update/import endpoints of the text/programming exercises.
- In case the access to the restricted modules is later on revoked by an admin, all the exercises that use a restricted module are updated and their suggestions module is set to null (= suggestions disabled).
Steps for Testing
Prerequisites:
- PR deployed on ma-schwind testserver
- 1 Admin
Test Case - Course creation
- As admin, navigate to the new course creation page
- Do not check the checkbox to disable access to restricted Athena modules for the new course (see screenshots for checkbox location)
- Create the course
- On the course overview page, there should be new info about the state of the Athena access (see screenshots for info location)
- Make sure that the Athena access is set to No
Test Case - Change access to restricted Athena modules
- Now, edit the course settings and set the restricted Athena checkbox to enabled and save the changes
- Once again, make sure that the state of the Athena access is now set to Yes
Test Case - Text Exercise Creation
- On the exercise page, click on the button to create a new text exercise
- On the exercise creation page, tick the box to enable feedback suggestions for the exercise
- A new dropdown should appear, showing a list of available Athena modules that can be used for the feedback suggestion generation
- Depending on the course's state of the Athena access, there should be different modules listed:
- restricted Access enabled: module_text_cofee, module_text_llm
- restricted Access disabled: module_text_cofee
- Select one of the available modules and create the exercise
- On the exercise detail page, there should be information displayed if feedback suggestions are enabled
- You should also edit the exercise and choose different modules/disable feedback suggestions and make sure the changes are persisted
Test Case - Programming Exercise Creation
- Now, do the same steps as for the text exercise for a programming exercise
- One difference for programming exercises is that you need to set a due date and set the assessment mode to manual. Otherwise, Athena can not be enabled.
- Depending on the course's state of the Athena access, there should be different modules listed:
- restricted Access enabled: module_example, module_programming_themisml, module_programming_llm
- restricted Access disabled: module_example, module_programming_themisml
Test Case - Revoke Access to restricted Athena modules
Prerequisites:
- The course has access to restricted Athena modules
- 1 Text + Programming Exercise with a restricted module selected
- 1 Text + Programming Exercise with an unrestricted module selected
- Edit the course and revoke the access to the restricted Athena modules for the course
- Save the course
- Make sure that the exercises with the restricted modules have been updated and the feedback suggestions have been disabled
- Make sure that the exercises with the unrestricted modules have not been changed and the feedback suggestions are still enabled
Review Progress
Performance Review
- [ ] I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
- [ ] I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance
Code Review
- [x] Code Review 1
- [x] Code Review 2
Manual Tests
- [x] Test 1
- [x] Test 2
Test Coverage
Client
Class/File | Line Coverage | Confirmation (assert/expect) |
---|---|---|
app.constants.ts | 100% | ✅ |
athena.service.ts | 91.93% | ✅ |
course-update.component.ts | 87.5% | ✅ |
course-detail.component.ts | 86.04% | ✅ |
course.model.ts | 100% | ✅ |
exercise.model.ts | 93.82% | ✅ |
programming-exercise-lifecycle.component.ts | 95.71% | ✅ |
exercise-feedback-suggestion-options.component.ts | 90% | ✅ |
Server
Class/File | Line Coverage | Confirmation (assert/expect) |
---|---|---|
Course.java | 91% | ✅ |
Exercise.java | 93% | ✅ |
ExerciseRepository.java | 67% | ✅ |
SubmissionService.java | 90% | ✅ |
TextExerciseImportService.java | 100% | ✅ |
AthenaFeedbackSendingService.java | 94% | ✅ |
AthenaFeedbackSuggestionsService.java | 100% | ✅ |
AthenaModuleService.java | 89% | ✅ |
AthenaRepositoryExportService.java | 92% | ✅ |
AthenaSubmissionSelectionService.java | 100% | ✅ |
AthenaSubmissionSendingService.java | 92% | ✅ |
ProgrammingExerciseImportService.java | 98% | ✅ |
AthenaScheduleService.java | 47% | ✅ |
AthenaResource.java | 88% | ✅ |
CourseResource.java | 95% | ✅ |
ProgrammingAssessmentResource.java | 89% | ✅ |
ProgrammingExerciseExportImportResource.java | 96% | ✅ |
ProgrammingExerciseResource.java | 90% | ✅ |
TextAssessmentResource.java | 90% | ✅ |
TextExerciseResource.java | 96% | ✅ |
Screenshots
Added checkbox in the course edit view to allow a course the usage of restricted Athena modules:
Added dropdown to select Athena module when creating or updating a programming exercise:
Added dropdown to select Athena module when creating or updating a text exercise:
Summary by CodeRabbit
-
New Features
- Introduced a more flexible feedback suggestion system by replacing the boolean flag with a module-based approach.
- Added support for restricted access to Athena modules in courses and exercises.
- Enhanced UI components to reflect the new feedback suggestion system and restricted Athena module access.
-
Refactor
- Updated various service and repository methods to align with the new feedback suggestion module system.
-
Style
- Adjusted user interface components for courses and exercises to accommodate new features related to feedback suggestions and Athena modules.
Walkthrough
This update introduces a shift from a Boolean feedbackSuggestionsEnabled
field to a feedbackSuggestionModule
String field in exercises, enhancing the feedback suggestion mechanism. It includes backend and frontend modifications to support this change, integrates Athena module services for exercise feedback, and extends course management to handle restricted Athena modules. The adjustments aim to refine feedback suggestion capabilities and manage Athena module access effectively.
Changes
File Path | Change Summary |
---|---|
.../domain/Exercise.java |
Replaced feedbackSuggestionsEnabled with feedbackSuggestionModule ; added isFeedbackSuggestionsEnabled method. |
.../repository/ExerciseRepository.java |
Updated imports, method signatures; added revokeAccessToRestrictedFeedbackSuggestionModulesByCourseId . |
.../service/SubmissionService.java |
Updated to use isFeedbackSuggestionsEnabled for condition checks. |
.../web/rest/*Resource.java |
Integrated AthenaModuleService ; updated feedback suggestion checks and handling. |
.../domain/Course.java |
Added restrictedAthenaModulesAccess field with accessors. |
.../service/connectors/athena/AthenaModuleService.java |
Introduced to handle Athena module fetching and access. |
src/main/webapp/app/... |
Updated to support new feedback suggestion mechanism and Athena module management. |
.../service/TextExerciseImportService.java |
Updated import logic to use feedbackSuggestionModule . |
.../spec/component/course/course-update.component.spec.ts |
Extended test to include restrictedAthenaModulesAccess functionality. |
Related issues
-
ls1intum/Artemis#7094: The changes in this PR could potentially address the objectives of extending Athena's capability to provide feedback suggestions for programming exercises by integrating a more flexible
feedbackSuggestionModule
field and managing Athena module access, which is fundamental for enabling such features across different types of exercises.
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?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>.
-
Generate unit-tests for this file.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitai
in a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit tests for this file.
-
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitai
in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai generate interesting stats about this repository and render them as a table.
-
@coderabbitai show all the console.log statements in this repository.
-
@coderabbitai read src/utils.ts and generate unit tests.
-
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
-
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)
-
@coderabbitai pause
to pause the reviews on a PR. -
@coderabbitai resume
to resume the paused reviews. -
@coderabbitai review
to trigger a review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai resolve
resolve all the CodeRabbit review comments. -
@coderabbitai help
to get help.
Additionally, you can add @coderabbitai ignore
anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml
)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yaml
file to the root of your repository. - The JSON schema for the configuration file is available here.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json
CodeRabbit Discord Community
Join our Discord Community to get help, request features, and share feedback.
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.
There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.
Manual test
On the exercise detail page, there should be information displayed if feedback suggestions are enabled and if yes, which module is selected (see screenshots for location)
The check mark will be shown properly, although the module name will be shown neither on the programming, nor on the text exercises page
Manual test
On the exercise detail page, there should be information displayed if feedback suggestions are enabled and if yes, which module is selected (see screenshots for location)
The check mark will be shown properly, although the module name will be shown neither on the programming, nor on the text exercises page
Yes, that's the intended behavior right now. The UI changed over the course of this PR, and therefore the code had to be adjusted. I updated the PR description