Skip to content
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: Allow to choose preliminary feedback model #10067

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from

Conversation

dmytropolityka
Copy link
Contributor

@dmytropolityka dmytropolityka commented Dec 23, 2024

Please test only on TS1
!!! Contains database migrations !!!

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) and too complex database calls.
  • I strictly followed the principle of data economy for all database calls.
  • I strictly followed the server coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

Client

  • 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 (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • I strictly followed the client coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).
  • I tested all changes and their related features with all corresponding user types on a test server configured with Gitlab and Jenkins.

Motivation and Context

Currently, Artemis allows only one module to be set for Athena Feedback Requests, be it for preliminary or graded feedback. This PR addresses the limitation and enables setting separate modules for each type of feedback.

Description

This PR introduces functionality that allows instructors to configure different Athena Feedback Request modules for preliminary feedback and graded feedback. Preliminary feedback can now be assigned a dedicated module without affecting the graded feedback settings.

Steps for Testing

Disclaimer:
Currently, only LLM modules support preliminary feedback. You can easily test this functionality with non-LLM modules to verify if the correct module is being used (non-LLM modules will not work).

  1. Deploy this branch on Test Server 1 (TS1).

As an instructor:
2. Navigate to the course settings.
3. Create a Programming, Text, or Modeling exercise.
4. Select a module for preliminary feedback (no due date required). For graded feedback, enable Feedback Suggestions, set a due date, and select a module(text or programming).
5. Save the changes.

As a student:
6. Open the created exercise.
7. Submit something.
8. Submit an AI feedback request.
9. Verify that the appropriate module is used based on the type of feedback.

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

  • 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 even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Screenshots

image
image

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new ModuleType enum with FEEDBACK_SUGGESTIONS and PRELIMINARY_FEEDBACK constants.
    • Added support for preliminary feedback modules across different exercise types.
    • Enhanced Athena feedback mechanisms with more granular module selection.
  • Improvements

    • Refined feedback request handling to distinguish between manual and preliminary feedback.
    • Updated terminology around feedback suggestions and requests.
    • Improved module access validation for Athena services.
  • Changes

    • Renamed allowFeedbackRequests to allowManualFeedbackRequests.
    • Added new properties feedbackSuggestionModule and preliminaryFeedbackModule to exercises.
    • Updated UI components to support new feedback module configurations.
  • Localization

    • Updated translation keys to reflect new feedback terminology.
    • Removed outdated feedback request translation entries.

These changes provide more flexible and precise feedback mechanisms across different exercise types.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. athena Pull requests that affect the corresponding module exercise Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module text Pull requests that affect the corresponding module labels Dec 23, 2024
Copy link

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.

@github-actions github-actions bot added the stale label Dec 30, 2024
@dmytropolityka dmytropolityka changed the title Feature/programming exercises/choose preliminary feedback model Programming exercises Allow to choose preliminary feedback model Jan 1, 2025
dmytropolityka and others added 3 commits January 1, 2025 23:34
…oose-preliminary-feedback-model' into feature/programming-exercises/choose-preliminary-feedback-model
@dmytropolityka dmytropolityka changed the title Programming exercises Allow to choose preliminary feedback model Programming exercises: Allow to choose preliminary feedback model Jan 1, 2025
@dmytropolityka dmytropolityka changed the title Programming exercises: Allow to choose preliminary feedback model Programming exercises: Allow to choose preliminary feedback model Jan 1, 2025
@github-actions github-actions bot added the core Pull requests that affect the corresponding module label Jan 2, 2025
Copy link

@coderabbitai coderabbitai bot left a 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 (1)
src/main/java/de/tum/cit/aet/artemis/modeling/service/ModelingExerciseFeedbackService.java (1)

155-155: Consider making the boolean parameter more descriptive.
Passing true directly into getModelingFeedbackSuggestions can reduce readability; it isn't immediately clear that this indicates preliminary feedback. Using an enum or a self-documenting boolean constant (e.g., PRELIMINARY_FEEDBACK = true) would clarify intent and improve maintainability.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97d8e59 and 0aeb2a0.

📒 Files selected for processing (8)
  • src/main/java/de/tum/cit/aet/artemis/athena/service/AthenaFeedbackSuggestionsService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/modeling/service/ModelingExerciseFeedbackService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExercise.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseCodeReviewFeedbackService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseImportService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseExportImportResource.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java (3 hunks)
  • src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseExportImportResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/domain/ProgrammingExercise.java
  • src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.ts
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseImportService.java
🧰 Additional context used
📓 Path-based instructions (3)
src/main/java/de/tum/cit/aet/artemis/modeling/service/ModelingExerciseFeedbackService.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

src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseCodeReviewFeedbackService.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

src/main/java/de/tum/cit/aet/artemis/athena/service/AthenaFeedbackSuggestionsService.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/programming/service/ProgrammingExerciseCodeReviewFeedbackService.java (1)
Learnt from: undernagruzez
PR: ls1intum/Artemis#8498
File: src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingExerciseCodeReviewFeedbackService.java:236-236
Timestamp: 2024-11-12T12:51:40.391Z
Learning: Rate limit exceptions for AI feedback requests are handled in the client app.
🔇 Additional comments (14)
src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseCodeReviewFeedbackService.java (1)

141-141: Double-check the switch from false to true.
Changing the final parameter in getProgrammingFeedbackSuggestions from false to true will generate graded feedback instead of non-graded. Verify that this switch actually aligns with your intended behavior for non-graded feedback use cases.

src/main/java/de/tum/cit/aet/artemis/athena/service/AthenaFeedbackSuggestionsService.java (13)

98-100: Good clarification in the doc comment.
Explicitly naming the parameter isPreliminary and describing it clarifies the method’s intention.


103-104: Verify logging message for 'Non Graded' vs. 'Graded'.
Here the log will print “Non Graded” if isPreliminary is true. Confirm that this matches your intended semantics for preliminary vs. non-preliminary feedback.


112-113: Parameter mapping to Athena.
Passing !isPreliminary to the isGraded field matches the requirement that Athena expects this boolean to indicate graded feedback. This is consistent with your prior clarification that “isGraded” must remain in the request.


114-117: Duplicate comment: Ensure null checks for feedback modules.
As highlighted in past review comments, calling exercise.getPreliminaryFeedbackModule() or exercise.getFeedbackSuggestionModule() might risk NullPointerException. Please ensure you validate these module references.


126-128: Documentation alignment for programming use case.
The doc comment correctly outlines the purpose of isPreliminary. It matches the text exercise’s approach.


131-131: Method signature clarity.
Introducing boolean isPreliminary in getProgrammingFeedbackSuggestions increases code clarity, mirroring the text feedback method. Nicely done.


133-135: Confirm 'Non Graded' logic in log statement.
Again, “Non Graded” is logged if isPreliminary is true. Confirm this matches the actual usage for preliminary feedback.


136-139: Duplicate comment: Validate module references.
Ensure each module reference (getPreliminaryFeedbackModule() or getFeedbackSuggestionModule()) is non-null before constructing the URL.


148-150: Doc comment consistency for modeling.
The parameter description is consistent across text, programming, and modeling, which helps maintain clarity.


153-154: Same logging pattern for 'Non Graded' feedback.
As in the other methods, ensure logging “Non Graded” is correct when isPreliminary is true.


161-162: Check parameter inversion with !isPreliminary.
As with the other methods, confirm that passing !isPreliminary to the record’s isGraded field is the desired approach for modeling feedback requests.


163-166: Duplicate comment: Validate module references for modeling.
Consider adding null checks to avoid potential NullPointerException here if the module isn’t configured.


167-168: Confirm final log statement for 'Non Graded' modeling feedback.
Logging “Non Graded” if isPreliminary is true is repeated throughout. Make sure it’s consistent with your intended meaning of “preliminary” feedback.

@dmytropolityka dmytropolityka added deploy:artemis-test1 and removed deployment-error Added by deployment workflows if an error occured labels Jan 5, 2025
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test1 labels Jan 6, 2025
@dmytropolityka dmytropolityka removed the deployment-error Added by deployment workflows if an error occured label Jan 6, 2025
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test1 labels Jan 6, 2025
@zagemello zagemello removed the deployment-error Added by deployment workflows if an error occured label Jan 6, 2025
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deployment-error Added by deployment workflows if an error occured labels Jan 6, 2025
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test1 labels Jan 6, 2025
@vinceclifford vinceclifford removed the deployment-error Added by deployment workflows if an error occured label Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
athena Pull requests that affect the corresponding module client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. exercise Pull requests that affect the corresponding module modeling Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module ready for review server Pull requests that update Java code. (Added Automatically!) tests text Pull requests that affect the corresponding module
Projects
Status: Ready For Review
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants