Skip to content

Conversation

@kevinfischer4
Copy link

@kevinfischer4 kevinfischer4 commented Nov 13, 2025

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 guidelines.
  • I strictly followed the AET UI-UX 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 documented the TypeScript code using JSDoc style.

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 LocalVC and Jenkins.

Motivation and Context

#11123
Improve Continuous Plagiarism Control Component Validation

Description

This PR improves the CPC configuration component.

  1. It now allows to configure the similarity threshold in steps of 1 instead of 5
  2. The minimum size field can now be set to values above 100
  3. It is not possible to create a CPC configuration with invalid values by sending a request to the server manually anymore

Steps for Testing

Prerequisites:

  • 1 Instructor

Client side:

  1. Log in as an instructor and go to a course where you can create/edit exercises
  2. Go to course management > exercises
  3. Click create new programming exercise
  4. On the button "Switch to advanced mode"
  5. Click "Show continuous plagiarism control" and enable it
  6. Verify that the field work as follows:
    6.1 You can increment/decrement the similarity threshold by 1 through the UI with a max value of 100
    6.2 You can set a value >100 for the minimum token count
    6.3 The "Significant similarity response period in days" can take values from 7-31
  7. Create the exercise and try the same thing in the editing mode of the exercise
  8. Do steps 3-7 again with a text exercise

Server side:

  1. Log in as an instructor and go to a course where you can create/edit exercises
  2. Go to course management > exercises
  3. Click create new programming exercise
  4. On the button "Switch to advanced mode"
  5. Click "Show continuous plagiarism control" and enable it
  6. Open the Network Tab in your browser to see outgoing requests
  7. Create the exercise and look for the request that was responsible for creating the exercise
  8. Copy the request and resend it manually to the server with invalid values in the CPC part (e.g. similarity = -1)
  9. Verify that the server returns a BadRequest

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

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

Test Coverage

Screenshots

image

response when request has invalid CPC values:
image

Summary by CodeRabbit

  • New Features

    • Plagiarism detection configuration now enforces comprehensive validation rules across file upload, modeling, programming, and text exercises. Invalid configurations are rejected during creation, updates, and imports to maintain system integrity.
  • Style

    • Input fields for plagiarism detection parameters now support finer-grained value increments for improved precision.

@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Nov 13, 2025
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) fileupload Pull requests that affect the corresponding module modeling Pull requests that affect the corresponding module plagiarism Pull requests that affect the corresponding module programming Pull requests that affect the corresponding module text Pull requests that affect the corresponding module labels Nov 13, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report205 ran199 passed3 skipped3 failed1h 13m 59s 262ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/quiz-exercise/QuizExerciseDropLocation.spec.ts
ts.Quiz Exercise Drop Location Spec › DnD Quiz drop locations › Checks drop locations❌ failure2m 3s 506ms
e2e/exam/test-exam/TestExamParticipation.spec.ts
ts.Test exam participation › Early Hand-in › Using exercise overview to navigate within exam❌ failure3m 42s 821ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 42s 806ms

@github-actions github-actions bot added the tests label Nov 15, 2025
@kevinfischer4 kevinfischer4 changed the title Chore/improve continuous plagiarism control component validation Plagiarism checks: Continuous plagiarism control component validation Nov 15, 2025
@kevinfischer4 kevinfischer4 changed the title Plagiarism checks: Continuous plagiarism control component validation Plagiarism checks: Improve continuous plagiarism control component validation Nov 15, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report205 ran201 passed3 skipped1 failed1h 8m 27s 71ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/quiz-exercise/QuizExerciseDropLocation.spec.ts
ts.Quiz Exercise Drop Location Spec › DnD Quiz drop locations › Checks drop locations❌ failure2m 3s 158ms

@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de November 19, 2025 17:46 Inactive
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report205 ran201 passed3 skipped1 failed1h 10m 10s 744ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 37s 66ms

@kevinfischer4 kevinfischer4 marked this pull request as ready for review November 19, 2025 18:19
@kevinfischer4 kevinfischer4 requested review from a team as code owners November 19, 2025 18:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Walkthrough

This pull request introduces comprehensive plagiarism detection configuration validation across multiple exercise types. A new validation method is added to the PlagiarismDetectionConfigHelper, validation constraints are applied to the PlagiarismDetectionConfig domain model, and validation calls are integrated into create/import/update workflows for file-upload, modeling, programming, and text exercises. Frontend UI refinements and extensive test coverage validate the new validation behavior.

Changes

Cohort / File(s) Summary
Core Validation Domain & Helper
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfig.java
Added Jakarta validation annotations (@Min, @Max) to constrains similarity threshold, minimum score, and minimum size fields.
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java
Exercise Resource Integration
src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java, src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
Added plagiarism config validation calls in create, import, and update workflows for file-upload and modeling exercises.
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java, src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
Frontend Components
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.html
Modified step attribute granularity: similarityThreshold now uses step="1" (changed from step="5"), minimumScore adds step="1".
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts
Unit Tests
src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
Introduced helper method and unit test suite validating validatePlagiarismDetectionConfigOrThrow() across boundary conditions, null configs, and range constraints.
Integration Tests
src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java, src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java, src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java
Added integration tests validating invalid plagiarism detection config rejection (BAD_REQUEST) across create, import, and update flows for each exercise type.
src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java, src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java, src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Validation logic consistency: Verify that validatePlagiarismDetectionConfigOrThrow() correctly implements all specified range constraints (similarityThreshold [0,100], minimumScore [0,100], minimumSize >= 0, continuousPlagiarismControlPlagiarismCaseStudentResponsePeriod [7,31]).
  • Placement correctness: Confirm validation is invoked at appropriate points in each exercise type's workflow (after auth, before persistence, before channel updates).
  • Frontend validation alignment: Ensure HTML input step attributes and TypeScript form validators align with backend constraints; verify removal of minimumSize max validator doesn't introduce undesired upper-bound behavior.
  • Test coverage completeness: Review test assertions across all exercise types for consistent error scenarios and boundary value coverage; check for any duplicated test methods within files.
  • Exception handling: Verify BadRequestAlertException is thrown with correct error codes and messages for each validation failure scenario.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.42% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: server-side and client-side validation improvements for continuous plagiarism control configuration across multiple exercise types.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/improve-continuous-plagiarism-control-component-validation

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.40.0)
src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java

[]

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@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 (7)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfig.java (1)

8-68: Bean Validation constraints for plagiarism config are well aligned

The new @Min/@Max annotations on similarityThreshold, minimumScore, and minimumSize correctly encode the same bounds used by the helper and UI (0–100 for percentages, >= 0 for size), improving safety without changing behavior.

If you want stricter symmetry, you could also consider annotating continuousPlagiarismControlPlagiarismCaseStudentResponsePeriod with @Min(7) / @Max(31), but the helper already enforces this range so it’s not strictly necessary.

src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java (1)

2429-2478: Programming exercise tests correctly assert BAD_REQUEST for invalid plagiarism configs

Both helper methods exercise the relevant invalid combinations (similarity threshold, minimum score, minimum size, and response period) against the create and update endpoints and assert HttpStatus.BAD_REQUEST, which matches the helper’s contract.

Minor style nit: you already import PlagiarismDetectionConfig, so you can simplify the first instantiation to use the simple class name for consistency:

-        var config = new de.tum.cit.aet.artemis.plagiarism.domain.PlagiarismDetectionConfig();
+        var config = new PlagiarismDetectionConfig();
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)

7-7: CPC config validation logic is sound; consider aligning Javadoc with implementation

The new validatePlagiarismDetectionConfigOrThrow centralizes CPC validation with clear ranges and uses BadRequestAlertException consistently. The only mismatch is the Javadoc rule “If continuousPlagiarismControlEnabled is true, config must not be null”, which is not enforced (and seems redundant given that flag lives on the config itself). Consider either enforcing that rule explicitly or removing it from the Javadoc to avoid confusion.

Also applies to: 56-91

src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java (1)

69-69: Consistent CPC validation across modeling create/update/import endpoints

Importing PlagiarismDetectionConfigHelper and validating in createModelingExercise, updateModelingExercise, and importExercise ensures modeling exercises cannot be saved with invalid CPC configs, including via the re-evaluate path that calls updateModelingExercise. For even tighter regression safety, you might later add a small import-specific test mirroring the new create/update tests, but the current wiring is correct.

Also applies to: 183-185, 264-266, 409-411

src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java (1)

993-1023: New modeling CPC integration tests cover the key invalid branches

The create/update tests for invalid PlagiarismDetectionConfig values line up with the helper’s bounds and should catch regressions in CPC validation behavior. If you want more precise failure diagnostics, you could additionally assert on the error key (e.g. invalidSimilarityThreshold, invalidResponsePeriod), but that’s optional given the current test style in this class.

Also applies to: 1025-1044

src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java (1)

75-75: Text exercise CPC tests are well-aligned with the shared validator

The new create/update tests for PlagiarismDetectionConfig exercise the same invalid ranges as the modeling tests and should reliably assert that text endpoints now enforce the shared helper’s bounds. As a small optional enhancement, you could add an import-flow variant and/or assert error keys to increase specificity, but the current coverage already meets the PR’s goals.

Also applies to: 353-405

src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java (1)

69-69: File-upload endpoints correctly adopt centralized CPC validation

Importing PlagiarismDetectionConfigHelper and invoking validatePlagiarismDetectionConfigOrThrow in create, import, and update ensures file-upload exercises cannot persist invalid CPC configs, and the re-evaluate path benefits via its call to updateFileUploadExercise. This is consistent with the modeling/text/programming resources. Just make sure FileUploadExerciseImportService.importFileUploadExercise(...) actually uses the importedFileUploadExercise’s plagiarism config as the basis for the new entity; if it ever copied the config solely from the source exercise, you’d want to apply the validator to the returned newFileUploadExercise instead.

Also applies to: 177-179, 235-237, 342-344

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa8bb23 and 7c5b98f.

📒 Files selected for processing (17)
  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java (4 hunks)
  • src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java (4 hunks)
  • src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfig.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java (3 hunks)
  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.html (1 hunks)
  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts (1 hunks)
  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java (3 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java (1 hunks)
  • src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java (2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
src/main/webapp/**/*.html

⚙️ CodeRabbit configuration file

@if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

Files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.html
src/main/java/**/*.java

⚙️ CodeRabbit configuration file

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

Files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfig.java
  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
  • src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
src/test/java/**/*.java

⚙️ CodeRabbit configuration file

test_naming: descriptive; test_size: small_specific; fixed_data: true; junit5_features: true; assert_use: assertThat; assert_specificity: true; archunit_use: enforce_package_rules; db_query_count_tests: track_performance; util_service_factory_pattern: true; avoid_db_access: true; mock_strategy: static_mocks; context_restart_minimize: true

Files:

  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
src/main/webapp/**/*.ts

⚙️ CodeRabbit configuration file

angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

Files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts
  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
🧠 Learnings (33)
📚 Learning: 2025-10-28T13:23:39.105Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11507
File: src/main/webapp/app/exam/manage/students/room-distribution/students-room-distribution-dialog.component.html:15-15
Timestamp: 2025-10-28T13:23:39.105Z
Learning: In the students room distribution dialog component (src/main/webapp/app/exam/manage/students/room-distribution/students-room-distribution-dialog.component.html and .ts), the reserve factor input intentionally uses type="text" instead of type="number" to support specific UX requirements: integer-only input with range 0-100, allowing temporary empty state during editing (which resets to 0), showing 0 only on blur when empty, and selecting all text on focus. This precise control is implemented through custom validation handlers (handleReserveFactorInput, resetReserveFactorText, selectAllTextAndOpenDropdown) which is not achievable with native number input constraints.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.html
  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts
  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-10T08:47:07.884Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:16-16
Timestamp: 2024-07-10T08:47:07.884Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting the removal of trivially inferred type annotations for the `step` property in `range-slider.component.ts`.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.html
  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2025-05-11T22:58:13.489Z
Learnt from: theblobinthesky
Repo: ls1intum/Artemis PR: 10581
File: src/main/webapp/app/exercise/import/from-file/exercise-import-from-file.component.ts:57-60
Timestamp: 2025-05-11T22:58:13.489Z
Learning: The ProgrammingExerciseBuildConfig constructor initializes all fields with default values, including new fields like allowBranching (false) and branchRegex ('.*'), so explicit handling of these fields isn't needed when importing old exercise configurations.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
📚 Learning: 2024-11-26T20:43:17.588Z
Learnt from: magaupp
Repo: ls1intum/Artemis PR: 9751
File: src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java:143-148
Timestamp: 2024-11-26T20:43:17.588Z
Learning: In `src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseFactory.java`, the test package name assigned in `populateUnreleasedProgrammingExercise` does not need to adhere to naming conventions.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
📚 Learning: 2025-10-22T21:31:54.240Z
Learnt from: Elfari1028
Repo: ls1intum/Artemis PR: 11491
File: src/main/java/de/tum/cit/aet/artemis/exercise/web/ExerciseResource.java:376-378
Timestamp: 2025-10-22T21:31:54.240Z
Learning: In Artemis, ExerciseVersionService.createExerciseVersion(...) (src/main/java/de/tum/cit/aet/artemis/exercise/service/ExerciseVersionService.java) eagerly re-fetches the target exercise (via type-specific findForVersioningById) before building the ExerciseSnapshotDTO. Controllers (e.g., ExerciseResource.toggleSecondCorrectionEnabled) do not need to reload the exercise before invoking createExerciseVersion.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java
  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
📚 Learning: 2024-10-08T15:35:48.767Z
Learnt from: jakubriegel
Repo: ls1intum/Artemis PR: 8050
File: src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismUtilService.java:125-136
Timestamp: 2024-10-08T15:35:48.767Z
Learning: The `createTeamTextExerciseAndSimilarSubmissions` method in `PlagiarismUtilService.java` uses fixed inputs as it is designed to be a test helper method for simplifying the setup of team exercises and submissions in tests.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java
  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java
  • src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
📚 Learning: 2024-08-05T00:11:50.650Z
Learnt from: magaupp
Repo: ls1intum/Artemis PR: 8802
File: src/main/resources/templates/rust/exercise/src/context.rs:1-1
Timestamp: 2024-08-05T00:11:50.650Z
Learning: Code inside the `exercise` directories in the Artemis platform is provided to students and is intended for them to implement. TODO comments in these directories are meant to guide students and should not be addressed in the PR.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
📚 Learning: 2025-06-10T12:26:42.449Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseImportFromFileService.java:108-117
Timestamp: 2025-06-10T12:26:42.449Z
Learning: In ProgrammingExerciseImportFromFileService, the current directory traversal logic for sharing imports (walking importExerciseDir before extraction) is working correctly in practice and should not be changed to more complex solutions, even if there are theoretical issues with the approach.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
📚 Learning: 2025-06-06T14:47:54.300Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/main/java/de/tum/cit/aet/artemis/programming/web/ExerciseSharingResource.java:122-135
Timestamp: 2025-06-06T14:47:54.300Z
Learning: In Artemis sharing platform integration (under "sharing" profile), endpoints in ExerciseSharingResource use checksum-based authentication with shared secrets instead of PreAuthorize annotations. These endpoints (like getProblemStatement, getExerciseDetails, loadShoppingBasket) validate security through sharingInfo.checkChecksum() calls rather than role-based access control, as they serve as API interfaces for external sharing platform communication.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
📚 Learning: 2025-02-11T12:05:49.151Z
Learnt from: janthoXO
Repo: ls1intum/Artemis PR: 9406
File: src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseParticipationResource.java:209-209
Timestamp: 2025-02-11T12:05:49.151Z
Learning: In ProgrammingExerciseParticipationResource, exam-related authorization checks and sensitive information filtering for results and feedbacks are handled by resultService.filterSensitiveInformationIfNecessary().

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
  • src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
📚 Learning: 2025-09-20T16:47:54.380Z
Learnt from: MoritzSpengler
Repo: ls1intum/Artemis PR: 11382
File: src/main/java/de/tum/cit/aet/artemis/quiz/service/QuizTrainingService.java:43-54
Timestamp: 2025-09-20T16:47:54.380Z
Learning: In QuizTrainingService.submitForTraining, cross-course validation is handled by the REST layer through authCheckService.checkHasAtLeastRoleInCourseElseThrow() which validates user access to the course before the service method is called, eliminating the need for additional courseId validation in the service layer.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
  • src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
📚 Learning: 2025-09-20T16:47:54.380Z
Learnt from: MoritzSpengler
Repo: ls1intum/Artemis PR: 11382
File: src/main/java/de/tum/cit/aet/artemis/quiz/service/QuizTrainingService.java:43-54
Timestamp: 2025-09-20T16:47:54.380Z
Learning: In QuizTrainingService.submitForTraining, cross-course mismatch protection is handled through PreAuthorize("hasAccessToCourse(#courseId)") authorization at the REST layer, ensuring users can only submit for courses they have access to, rather than through explicit courseId validation in the service method.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: jakubriegel
Repo: ls1intum/Artemis PR: 8050
File: src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismUtilService.java:62-66
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The `createCourseWithUsers` method in `PlagiarismUtilService.java` uses fixed inputs as it is designed to be a test helper method for simplifying the setup of courses and users in tests.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java
  • src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
  • src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: julian-christl
Repo: ls1intum/Artemis PR: 8052
File: src/test/java/de/tum/in/www1/artemis/lecture/CompetencyIntegrationTest.java:310-310
Timestamp: 2024-06-10T19:44:09.116Z
Learning: Modifications to parameters in `competencyProgressUtilService.createCompetencyProgress` for debugging purposes are considered irrelevant to the test outcomes but helpful for clarity during debugging.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
📚 Learning: 2024-10-15T11:33:17.915Z
Learnt from: alexjoham
Repo: ls1intum/Artemis PR: 9455
File: src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java:401-401
Timestamp: 2024-10-15T11:33:17.915Z
Learning: In the Artemis project, when new fields are added to classes like `PyrisChatStatusUpdateDTO`, corresponding tests may be implemented in separate integration test classes such as `IrisChatTokenTrackingIntegrationTest`.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:988-993
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `testSubmitStudentExam_differentUser` method does not require additional checks to verify the state of `studentExam1` after receiving a `HttpStatus.FORBIDDEN` because the control flow in the `StudentExamResource` is straightforward and ensures no state change occurs.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:975-980
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `testSubmitStudentExam_notInTime` method does not require additional checks to verify the state of `studentExam1` after receiving a `HttpStatus.FORBIDDEN` because the control flow in the `StudentExamResource` is straightforward and ensures no state change occurs.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:2836-2846
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `testAbandonStudentExamNotInTime` method does not require additional checks to verify the state of `studentExam1` after receiving a `HttpStatus.FORBIDDEN` because the control flow in the `StudentExamResource` is straightforward and ensures no state change occurs.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/programming/util/ProgrammingExerciseTestService.java
  • src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
📚 Learning: 2025-09-25T11:25:54.261Z
Learnt from: Elfari1028
Repo: ls1intum/Artemis PR: 11351
File: src/main/java/de/tum/cit/aet/artemis/versioning/dto/QuizExerciseSnapshotDTO.java:52-53
Timestamp: 2025-09-25T11:25:54.261Z
Learning: In the Artemis versioning system, quiz questions processed by QuizExerciseSnapshotDTO should always have valid IDs (non-null getId()) since versioning works with persisted entities, making null filtering unnecessary according to Elfari1028.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
  • src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java
  • src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java
📚 Learning: 2025-08-14T20:54:54.294Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11111
File: src/main/java/de/tum/cit/aet/artemis/exam/domain/room/LayoutStrategy.java:25-36
Timestamp: 2025-08-14T20:54:54.294Z
Learning: In the Artemis codebase, entity fields with `Column(nullable = false)` are considered sufficient for null validation without requiring additional Bean Validation annotations like `NotNull`, as the project follows a pattern of avoiding redundant validation constraints.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfig.java
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: julian-christl
Repo: ls1intum/Artemis PR: 7829
File: src/main/java/de/tum/in/www1/artemis/web/rest/ComplaintResponseResource.java:0-0
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The user has fixed the issue regarding the redundant wildcard import in `ComplaintResponseResource.java` by removing it in commit 7e392e0.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java
📚 Learning: 2025-09-01T10:20:40.706Z
Learnt from: Michael-Breu-UIbk
Repo: ls1intum/Artemis PR: 10989
File: src/main/webapp/app/programming/manage/detail/programming-exercise-detail.component.with-sharing.spec.ts:132-149
Timestamp: 2025-09-01T10:20:40.706Z
Learning: In the Artemis codebase, Angular component test files for ProgrammingExerciseDetailComponent follow a pattern where the component is imported but not explicitly declared in TestBed.configureTestingModule(), yet TestBed.createComponent() still works successfully. This pattern is consistently used across test files like programming-exercise-detail.component.spec.ts and programming-exercise-detail.component.with-sharing.spec.ts.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts
📚 Learning: 2024-07-16T19:27:15.402Z
Learnt from: SimonEntholzer
Repo: ls1intum/Artemis PR: 8929
File: src/test/java/de/tum/in/www1/artemis/authentication/UserLocalVcIntegrationTest.java:29-33
Timestamp: 2024-07-16T19:27:15.402Z
Learning: When addressing missing test coverage, ensure that new tests specifically validate the functionality introduced in the PR, such as token-based authentication.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts
📚 Learning: 2024-10-13T12:03:02.430Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 9463
File: src/test/javascript/spec/component/shared/monaco-editor/monaco-editor.service.spec.ts:50-55
Timestamp: 2024-10-13T12:03:02.430Z
Learning: In `src/test/javascript/spec/component/shared/monaco-editor/monaco-editor.service.spec.ts`, when a function is called multiple times in a test, use `toHaveBeenCalledTimes` and `toHaveBeenNthCalledWith` assertions instead of `toHaveBeenCalledExactlyOnceWith`.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts
📚 Learning: 2024-11-02T22:57:57.717Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 9656
File: src/main/webapp/app/lecture/lecture-unit/lecture-unit-management/attachment-unit-form/attachment-unit-form.component.ts:69-71
Timestamp: 2024-11-02T22:57:57.717Z
Learning: In the `src/main/webapp/app/lecture/lecture-unit/lecture-unit-management/attachment-unit-form/attachment-unit-form.component.ts`, the `isFormValid` computed property intentionally uses a logical OR between `this.statusChanges() === 'VALID'` and `this.fileName()` to mirror the original `isSubmitPossible` getter, ensuring consistent form validation behavior.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts
  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:65-80
Timestamp: 2024-10-08T15:35:42.972Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting changing the type of the `event` parameter in the `ensureMinValueIsSmallerThanMaxValueViceVersa` method in `range-slider.component.ts`.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-09T19:07:38.801Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/exercise-filter/exercise-filter-modal.component.ts:185-188
Timestamp: 2024-07-09T19:07:38.801Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting moving assignments out of expressions within the `resetFilter` method in `exercise-filter-modal.component.ts`.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-10T08:46:02.595Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:60-63
Timestamp: 2024-07-10T08:46:02.595Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting changing the type for the `event` parameter in the `onSelectedMinValueChanged` and `onSelectedMaxValueChanged` methods in `range-slider.component.ts`.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-10T08:46:07.854Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:55-58
Timestamp: 2024-07-10T08:46:07.854Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting changing the type of the `event` parameter in the `onSelectedMinValueChanged` method in `range-slider.component.ts`.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2024-07-10T08:46:22.532Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/main/webapp/app/shared/range-slider/range-slider.component.ts:35-52
Timestamp: 2024-07-10T08:46:22.532Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting changes related to the `querySelectorAll` method in the `ngOnInit` method of the `RangeSliderComponent`.

Applied to files:

  • src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts
📚 Learning: 2025-08-11T13:22:05.140Z
Learnt from: Wallenstein61
Repo: ls1intum/Artemis PR: 10989
File: src/test/java/de/tum/cit/aet/artemis/programming/service/sharing/ExerciseSharingResourceImportTest.java:128-131
Timestamp: 2025-08-11T13:22:05.140Z
Learning: In the ExerciseSharingResourceImportTest class in Artemis, mockServer.verify() is not needed in the tearDown method as the test design doesn't require strict verification of all mocked HTTP expectations. The mockServer field is managed differently in this test class.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java
📚 Learning: 2025-08-30T20:20:17.236Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11111
File: src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomIntegrationTest.java:0-0
Timestamp: 2025-08-30T20:20:17.236Z
Learning: In ExamRoomIntegrationTest.validateAdminOverview(), the first assertion should use subset containment (contains) rather than exact equality because the admin overview shows all newest unique exam rooms in the system including those from previous uploads, not just rooms from the current upload being tested. The test only needs to verify that the expected rooms from the current upload are present in the response.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/test/java/de/tum/in/www1/artemis/exam/StudentExamIntegrationTest.java:2804-2810
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The `postWithoutLocation` method used in the `testAbandonStudentExam` test case already checks the response status, ensuring that the abandonment of the exam is accepted.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java
🧬 Code graph analysis (9)
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
  • PlagiarismDetectionConfigHelper (17-92)
src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
  • PlagiarismDetectionConfigHelper (17-92)
src/main/java/de/tum/cit/aet/artemis/fileupload/web/FileUploadExerciseResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
  • PlagiarismDetectionConfigHelper (17-92)
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts (1)
src/main/webapp/app/exercise/shared/entities/exercise/exercise.model.ts (1)
  • DEFAULT_PLAGIARISM_DETECTION_CONFIG (58-65)
src/test/java/de/tum/cit/aet/artemis/text/TextExerciseIntegrationTest.java (1)
src/main/webapp/app/exercise/shared/entities/exercise/exercise.model.ts (1)
  • PlagiarismDetectionConfig (49-56)
src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
  • PlagiarismDetectionConfigHelper (17-92)
src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
  • PlagiarismDetectionConfigHelper (17-92)
src/test/java/de/tum/cit/aet/artemis/modeling/ModelingExerciseIntegrationTest.java (1)
src/test/java/de/tum/cit/aet/artemis/modeling/util/ModelingExerciseFactory.java (1)
  • ModelingExerciseFactory (19-158)
src/main/java/de/tum/cit/aet/artemis/modeling/web/ModelingExerciseResource.java (1)
src/main/java/de/tum/cit/aet/artemis/plagiarism/domain/PlagiarismDetectionConfigHelper.java (1)
  • PlagiarismDetectionConfigHelper (17-92)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (13)
src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.ts (1)

36-38: Form validator for minimumSize matches backend rules

Removing the max constraint and keeping Validators.min(0) makes the client consistent with the backend’s @Min(0) constraint and the requirement to allow large minimum sizes.

src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.html (1)

42-59: Numeric input steps and bounds now reflect CPC UX and validation

similarityThreshold and minimumScore using step="1" (with [0,100]) plus minimumSize with min="0" are consistent with the form validators and the requirement to allow fine-grained thresholds and large minimum sizes.

src/main/webapp/app/plagiarism/manage/exercise-update-plagiarism/exercise-update-plagiarism.component.spec.ts (1)

132-323: CPC form validation tests are comprehensive and consistent with backend rules

The added tests exercise all key client-side constraints (bounds, required-when-enabled behavior, large minimumSize, and correct enable/disable of CPC controls) and verify propagation into exercise.plagiarismDetectionConfig, giving solid coverage of the new behavior.

src/test/java/de/tum/cit/aet/artemis/programming/icl/ProgrammingExerciseLocalVCLocalCIIntegrationTest.java (1)

369-379: LocalVC/LocalCI integration tests correctly delegate invalid-config scenarios

Adding the two delegating tests keeps this class consistent with the existing pattern and ensures the invalid plagiarism config behavior is also exercised under the LocalVC/LocalCI setup.

src/main/java/de/tum/cit/aet/artemis/text/web/TextExerciseCreationUpdateResource.java (1)

43-203: Text exercise flows now share centralized plagiarism config validation

Importing PlagiarismDetectionConfigHelper and invoking validatePlagiarismDetectionConfigOrThrow in both createTextExercise and updateTextExercise cleanly enforces the shared CPC constraints for text exercises before any persistence or external-service interaction.

src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseCreationResource.java (1)

41-116: Programming exercise creation now enforces shared plagiarism config validation

Calling PlagiarismDetectionConfigHelper.validatePlagiarismDetectionConfigOrThrow after the standard programming-exercise validations integrates CPC constraints into the create endpoint and keeps behavior consistent with other exercise resources.

src/main/java/de/tum/cit/aet/artemis/programming/web/ProgrammingExerciseUpdateResource.java (1)

40-40: Plagiarism config validation is correctly integrated into the programming update flow

Calling PlagiarismDetectionConfigHelper.validatePlagiarismDetectionConfigOrThrow(updatedProgrammingExercise, ENTITY_NAME) after the existing validation service and authorization (but before loading and updating the persisted exercise) fits the controller’s pattern and ensures invalid CPC configs are rejected also via the re-evaluate endpoint that forwards here.

Also applies to: 137-138

src/test/java/de/tum/cit/aet/artemis/programming/ProgrammingExerciseLocalVCJenkinsIntegrationTest.java (1)

650-660: LGTM! Tests follow established patterns.

Both new test methods properly delegate to the test service and follow the established naming and annotation conventions used throughout the file. The tests are small, specific, and appropriately placed.

src/test/java/de/tum/cit/aet/artemis/fileupload/FileUploadExerciseIntegrationTest.java (3)

677-709: LGTM! Comprehensive validation coverage.

The test effectively covers multiple invalid configuration scenarios (negative similarity threshold, score above 100, negative minimum size, and invalid response period). The sequential approach efficiently tests different boundary violations in a single test method while maintaining clarity.


711-730: LGTM! Update validation properly tested.

The test correctly validates invalid plagiarism detection configurations during exercise updates, covering upper boundary violations for similarity threshold and response period.


732-751: LGTM! Import validation properly tested.

The test correctly validates invalid plagiarism detection configurations during exercise imports, covering a lower boundary violation for minimum score. The test properly sets up the import scenario with a different course and channel name.

src/test/java/de/tum/cit/aet/artemis/plagiarism/PlagiarismDetectionConfigHelperTest.java (2)

22-28: LGTM! Good test utility additions.

The constant and helper method reduce duplication and improve test maintainability. The createExerciseWithConfig() helper follows the factory pattern commonly used in test utilities.


101-176: LGTM! Comprehensive validation test coverage.

The new validation tests thoroughly cover all boundary conditions for plagiarism detection configuration:

  • Valid default and null configurations
  • Similarity threshold range [0, 100]
  • Minimum score range [0, 100]
  • Minimum size non-negative
  • Response period range [7, 31]

The tests use appropriate AssertJ assertions (assertThatCode, assertThatThrownBy) and follow coding guidelines for test naming, size, and specificity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client Pull requests that update TypeScript code. (Added Automatically!) fileupload Pull requests that affect the corresponding module modeling Pull requests that affect the corresponding module plagiarism 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: Work In Progress

Development

Successfully merging this pull request may close these issues.

Improve Continuous Plagiarism Control Component Validation

2 participants