Skip to content

Conversation

@SamuelRoettgermann
Copy link
Contributor

@SamuelRoettgermann SamuelRoettgermann commented Sep 25, 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.

Motivation and Context

The current iPad app used for attendance checking during exams is rather cumbersome to use. Because of this it was modernized to provide a more pleasant attendance checking time.

Description

This PR introduces the GET api/exam/courses/{courseId}/exams/{examId}/attendance-checker-information endpoint that allows instructors of a course to obtain information about the rooms and seating assignments for a given exam. This information is used by the iPad app that exam supervisors use for marking attendance.

Testing

The actual feature testing is done in this separate PR that introduces the modern iPad version: ls1intum/ArtemisExamChecker#43

Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls) 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

Test Coverage

Summary by CodeRabbit

  • New Features

    • Attendance-checker API added: returns exam metadata, rooms used, and student seating (includes planned and actual in-memory locations).
  • Repository

    • Added query to fetch exam rooms by exam id to support attendance data.
  • API

    • New endpoint exposes attendance-checker information with tutor-level access; student-update endpoint now returns a user DTO and requires tutor-level access. Active-exams listing broadened to tutor-level.
  • Error Messages

    • Added "no students distributed" message; removed redundant room/seat error keys.
  • Tests

    • Integration tests for the attendance-checker endpoint across roles and distribution scenarios.

… needs to be an AbstractAuditingEntity, still need to figure out what to do with capacity and if I even need it but might store capacity with the layouts directly
…l need to return a DTO, still need helper functions
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

♻️ Duplicate comments (1)
src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java (1)

221-226: Re-verify tutor access for attendance checking.

As previously noted, exam attendance verification is typically performed by tutors. The current implementation blocks tutors with FORBIDDEN, which may be incorrect if tutors should have access to the attendance checker endpoint.

Based on past review comments.

🧹 Nitpick comments (2)
src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java (2)

261-262: Consider tightening time assertion precision.

The time assertions use a 1-second tolerance, but given that dates are stored and retrieved without intermediate now() calls, the difference should be minimal (primarily serialization precision). Consider using millisecond precision for consistency with similar tests.

Apply this diff:

-        assertThat(attendanceCheckerInformation.startDate()).isCloseTo(exam1.getStartDate(), byLessThan(1, ChronoUnit.SECONDS));
-        assertThat(attendanceCheckerInformation.endDate()).isCloseTo(exam1.getEndDate(), byLessThan(1, ChronoUnit.SECONDS));
+        assertThat(attendanceCheckerInformation.startDate()).isCloseTo(exam1.getStartDate(), byLessThan(1, ChronoUnit.MILLIS));
+        assertThat(attendanceCheckerInformation.endDate()).isCloseTo(exam1.getEndDate(), byLessThan(1, ChronoUnit.MILLIS));

Based on learnings.


284-294: Consider extracting legacy distribution setup to utility service.

The helper method directly accesses repositories to simulate legacy distribution data. While this is acceptable for setting up legacy state that cannot be created through REST endpoints, consider extracting this to a shared utility service (e.g., ExamUtilService) for better reusability across test classes.

As per coding guidelines (util_service_factory_pattern: true).

📜 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 665a35b and 30d17fb.

📒 Files selected for processing (1)
  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
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/exam/ExamRoomDistributionIntegrationTest.java
🧠 Learnings (21)
📓 Common learnings
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:266-268
Timestamp: 2025-10-25T22:42:09.687Z
Learning: In ExamRoomDistributionService.getAttendanceCheckerAppInformation method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, the validation intentionally uses noneMatch to allow partial distributions. This design ensures the iPad attendance checker app remains functional even when students are registered after the initial distribution (e.g., during an exam), preventing the entire app from breaking due to a few missing seat assignments.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/web/ExamRoomDistributionResource.java:62-78
Timestamp: 2025-09-25T20:43:41.712Z
Learning: In the ExamRoomDistributionService.distributeRegisteredStudents method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, ExamRoom entities are shared resources that are dynamically assigned to exams through the ExamRoomExamAssignment join table. Rooms don't "belong" to exams until the distribution process creates these assignments. The method first clears existing assignments for the exam, then creates new ones for the provided room IDs.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:13-16
Timestamp: 2025-09-15T11:18:26.439Z
Learning: In ExamRoomDistributionService.distributeRegisteredStudents method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, the team has decided not to use Transactional annotation despite multiple repository operations, based on human reviewer consultation.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/domain/ExamUser.java:16-17
Timestamp: 2025-09-25T20:28:36.905Z
Learning: In the Artemis codebase, ExamUser entity uses ExamSeatDTO as a transient field for performance reasons. SamuelRoettgermann tested domain value objects but they caused 60x slower performance. This architectural exception is approved by maintainers due to significant performance benefits and Artemis naming convention requirements.
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.
Learnt from: Strohgelaender
Repo: ls1intum/Artemis PR: 8574
File: src/main/java/de/tum/in/www1/artemis/service/tutorialgroups/TutorialGroupService.java:0-0
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The `tryToFindMatchingUsers` method in `TutorialGroupService.java` has been updated to skip registrations without a student, enhancing the method's robustness. This change was implemented in commit `bef30f9751de0913143e8cb28cc0088264052261`.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:72-79
Timestamp: 2025-09-15T11:21:15.983Z
Learning: SamuelRoettgermann prefers iterative development approach - initial implementations should be working starting points rather than full-fledged, finished implementations. Optimization and robustness improvements can be added later.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java:191-191
Timestamp: 2025-09-25T22:36:36.450Z
Learning: SamuelRoettgermann uses crude/temporary implementations during early development stages for testing and validation purposes, acknowledging they are not production-ready but helpful for confirming functionality works as expected.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRoomRepository.java:66-82
Timestamp: 2025-09-15T09:49:44.876Z
Learning: SamuelRoettgermann prefers using ROW_NUMBER() with window functions to handle tie-breaking scenarios in SQL queries, particularly when selecting the latest version of entities based on timestamps.
📚 Learning: 2025-09-25T20:43:41.712Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/web/ExamRoomDistributionResource.java:62-78
Timestamp: 2025-09-25T20:43:41.712Z
Learning: In the ExamRoomDistributionService.distributeRegisteredStudents method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, ExamRoom entities are shared resources that are dynamically assigned to exams through the ExamRoomExamAssignment join table. Rooms don't "belong" to exams until the distribution process creates these assignments. The method first clears existing assignments for the exam, then creates new ones for the provided room IDs.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2025-09-15T11:18:26.439Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:13-16
Timestamp: 2025-09-15T11:18:26.439Z
Learning: In ExamRoomDistributionService.distributeRegisteredStudents method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, the team has decided not to use Transactional annotation despite multiple repository operations, based on human reviewer consultation.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.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/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2025-10-25T22:42:09.687Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:266-268
Timestamp: 2025-10-25T22:42:09.687Z
Learning: In ExamRoomDistributionService.getAttendanceCheckerAppInformation method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, the validation intentionally uses noneMatch to allow partial distributions. This design ensures the iPad attendance checker app remains functional even when students are registered after the initial distribution (e.g., during an exam), preventing the entire app from breaking due to a few missing seat assignments.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2025-09-25T20:48:13.391Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/test/java/de/tum/cit/aet/artemis/exam/test_repository/ExamRoomTestRepository.java:18-34
Timestamp: 2025-09-25T20:48:13.391Z
Learning: In ExamRoomTestRepository JPQL queries in src/test/java/de/tum/cit/aet/artemis/exam/test_repository/ExamRoomTestRepository.java, CTE (Common Table Expression) syntax with bare attribute names like `roomNumber`, `name`, `createdDate` inside the WITH clause works correctly without requiring entity aliases, confirmed working by SamuelRoettgermann in their Artemis/Hibernate setup.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2025-09-25T20:28:36.905Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/domain/ExamUser.java:16-17
Timestamp: 2025-09-25T20:28:36.905Z
Learning: In the Artemis codebase, ExamUser entity uses ExamSeatDTO as a transient field for performance reasons. SamuelRoettgermann tested domain value objects but they caused 60x slower performance. This architectural exception is approved by maintainers due to significant performance benefits and Artemis naming convention requirements.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2025-06-15T04:13:22.541Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 10921
File: src/test/java/de/tum/cit/aet/artemis/exam/ExamIntegrationTest.java:1334-1339
Timestamp: 2025-06-15T04:13:22.541Z
Learning: In Artemis ExamIntegrationTest, time difference assertions use ChronoUnit.MILLIS.between().isLessThan(1) without Math.abs() because the server only stores and retrieves timestamp values without calling now(), making differences predictable and consistent due to serialization/storage precision rather than timing variations.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: Strohgelaender
Repo: ls1intum/Artemis PR: 8574
File: src/main/java/de/tum/in/www1/artemis/service/tutorialgroups/TutorialGroupService.java:0-0
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The `tryToFindMatchingUsers` method in `TutorialGroupService.java` has been updated to skip registrations without a student, enhancing the method's robustness. This change was implemented in commit `bef30f9751de0913143e8cb28cc0088264052261`.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.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/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2025-08-14T21:24:50.201Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11111
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomService.java:150-152
Timestamp: 2025-08-14T21:24:50.201Z
Learning: In the ExamRoomService.parseAndStoreExamRoomDataFromZipFile method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomService.java, IllegalArgumentException cannot be thrown in the try block, so only IOException needs to be caught when parsing ZIP files containing exam room JSON data.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: JohannesStoehr
Repo: ls1intum/Artemis PR: 0
File: :0-0
Timestamp: 2024-06-10T19:44:09.116Z
Learning: Admins are included in the `isAtLeastTutor` check, and unauthenticated users cannot access the `CourseTutorialGroupsComponent`.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.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/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.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/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.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/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2025-08-15T00:59:12.716Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11111
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomService.java:15-17
Timestamp: 2025-08-15T00:59:12.716Z
Learning: In ExamRoomService.java, Joda-Time is used specifically for duration formatting because the user needs a formatter that always includes millisecond precision, which they found difficult or impossible to achieve with java.time Duration formatting.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2024-10-14T10:30:20.109Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/main/java/de/tum/in/www1/artemis/service/exam/StudentExamService.java:295-303
Timestamp: 2024-10-14T10:30:20.109Z
Learning: The `abandonStudentExam` method in `StudentExamService` should not include a null check for the `studentExam` parameter as per the project's coding practices. It is expected that the `studentExam` will never be null at this point in the code, and a `NullPointerException` would indicate a significant issue elsewhere in the codebase.

Applied to files:

  • src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.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/exam/ExamRoomDistributionIntegrationTest.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/exam/ExamRoomDistributionIntegrationTest.java
📚 Learning: 2024-10-08T15:35:42.972Z
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-10-08T15:35:42.972Z
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/exam/ExamRoomDistributionIntegrationTest.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/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
🧬 Code graph analysis (1)
src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java (1)
src/test/java/de/tum/cit/aet/artemis/exam/util/ExamRoomZipFiles.java (1)
  • ExamRoomZipFiles (12-93)
⏰ 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). (8)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Build and Push Docker Image / Build linux/amd64 Docker Image for ls1intum/artemis
  • GitHub Check: Build and Push Docker Image / Build linux/arm64 Docker Image for ls1intum/artemis
  • GitHub Check: client-tests
  • GitHub Check: submit-gradle
  • GitHub Check: server-tests
  • GitHub Check: Analyse
  • GitHub Check: bean-instantiation-check

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 4, 2025
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ✅SkippedFailedTime ⏱
End-to-End (E2E) Test Report1 ran1 passed0 skipped0 failed1s 624ms
TestResultTime ⏱
No test annotations available

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de November 4, 2025 12:45 Inactive
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report205 ran201 passed3 skipped1 failed1h 20m 43s 641ms
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 419ms

@SamuelRoettgermann SamuelRoettgermann temporarily deployed to artemis-test3.artemis.cit.tum.de November 4, 2025 19:34 — with GitHub Actions Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de November 5, 2025 15:51 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de November 5, 2025 19:00 Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de November 6, 2025 11:05 Inactive
@SamuelRoettgermann SamuelRoettgermann temporarily deployed to artemis-test3.artemis.cit.tum.de November 6, 2025 12:25 — with GitHub Actions Inactive
@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de November 6, 2025 12:34 Inactive
@github-actions
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 Nov 12, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 18, 2025
@SamuelRoettgermann SamuelRoettgermann temporarily deployed to artemis-test3.artemis.cit.tum.de November 18, 2025 14:53 — with GitHub Actions Inactive
@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 20m 31s 361ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exam/ExamDateVerification.spec.ts
ts.Exam date verification › Exam timing › Student can start after start Date❌ failure2m 5s 37ms
e2e/exercise/quiz-exercise/QuizExerciseDropLocation.spec.ts
ts.Quiz Exercise Drop Location Spec › DnD Quiz drop locations › Checks drop locations❌ failure2m 3s 982ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure4m 21s 920ms

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java (1)

70-86: Tutor-level access change and access check look consistent; Javadoc slightly outdated

Switching to @EnforceAtLeastTutorInCourse with checkCourseAndExamAccessForTeachingAssistantElseThrow aligns with the goal of allowing tutors to perform attendance updates while still enforcing course-scoped authorization, matching the least-access and REST-layer-authorization guidelines. As a minor follow-up, the Javadoc @return text still says “saved examUser ResponseEntity” even though the method now returns an ExamUserDTO; consider updating the wording to reference the DTO.

🧹 Nitpick comments (1)
src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java (1)

106-116: DTO mapping is correct; consider centralizing mapping and clarify intentional field nulls

The assignments from ExamUser to ExamUserDTO (login, actual room/seat, check flags, signingImagePath) are ordered correctly and the update/save flow is sound. However, the manual new ExamUserDTO(...) here partially duplicates mapping concerns and hardcodes several fields to null. If this DTO is or becomes used in multiple endpoints, consider an ExamUserExamUserDTO mapper (e.g., in ExamUserService or a dedicated mapper class) that can produce a minimal “attendance update” view while keeping mapping logic in one place and making the intentional omission of name/email/registration fields explicit.

📜 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 c0d9c53 and 1cf5750.

📒 Files selected for processing (5)
  • src/main/java/de/tum/cit/aet/artemis/exam/dto/ExamUserDTO.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java (2 hunks)
  • src/main/java/de/tum/cit/aet/artemis/exam/service/ExamService.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamResource.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
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/exam/repository/ExamRepository.java
  • src/main/java/de/tum/cit/aet/artemis/exam/service/ExamService.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/dto/ExamUserDTO.java
🧠 Learnings (34)
📓 Common learnings
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:266-268
Timestamp: 2025-10-25T22:42:09.687Z
Learning: In ExamRoomDistributionService.getAttendanceCheckerAppInformation method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, the validation intentionally uses noneMatch to allow partial distributions. This design ensures the iPad attendance checker app remains functional even when students are registered after the initial distribution (e.g., during an exam), preventing the entire app from breaking due to a few missing seat assignments.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/web/ExamRoomDistributionResource.java:62-78
Timestamp: 2025-09-25T20:43:41.712Z
Learning: In the ExamRoomDistributionService.distributeRegisteredStudents method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, ExamRoom entities are shared resources that are dynamically assigned to exams through the ExamRoomExamAssignment join table. Rooms don't "belong" to exams until the distribution process creates these assignments. The method first clears existing assignments for the exam, then creates new ones for the provided room IDs.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:13-16
Timestamp: 2025-09-15T11:18:26.439Z
Learning: In ExamRoomDistributionService.distributeRegisteredStudents method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, the team has decided not to use Transactional annotation despite multiple repository operations, based on human reviewer consultation.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/domain/ExamUser.java:16-17
Timestamp: 2025-09-25T20:28:36.905Z
Learning: In the Artemis codebase, ExamUser entity uses ExamSeatDTO as a transient field for performance reasons. SamuelRoettgermann tested domain value objects but they caused 60x slower performance. This architectural exception is approved by maintainers due to significant performance benefits and Artemis naming convention requirements.
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.
Learnt from: Strohgelaender
Repo: ls1intum/Artemis PR: 8574
File: src/main/java/de/tum/in/www1/artemis/service/tutorialgroups/TutorialGroupService.java:0-0
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The `tryToFindMatchingUsers` method in `TutorialGroupService.java` has been updated to skip registrations without a student, enhancing the method's robustness. This change was implemented in commit `bef30f9751de0913143e8cb28cc0088264052261`.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:72-79
Timestamp: 2025-09-15T11:21:15.983Z
Learning: SamuelRoettgermann prefers iterative development approach - initial implementations should be working starting points rather than full-fledged, finished implementations. Optimization and robustness improvements can be added later.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java:191-191
Timestamp: 2025-09-25T22:36:36.450Z
Learning: SamuelRoettgermann uses crude/temporary implementations during early development stages for testing and validation purposes, acknowledging they are not production-ready but helpful for confirming functionality works as expected.
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRoomRepository.java:66-82
Timestamp: 2025-09-15T09:49:44.876Z
Learning: SamuelRoettgermann prefers using ROW_NUMBER() with window functions to handle tie-breaking scenarios in SQL queries, particularly when selecting the latest version of entities based on timestamps.
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: Strohgelaender
Repo: ls1intum/Artemis PR: 8574
File: src/main/java/de/tum/in/www1/artemis/service/tutorialgroups/TutorialGroupService.java:0-0
Timestamp: 2024-10-08T15:35:42.972Z
Learning: The `tryToFindMatchingUsers` method in `TutorialGroupService.java` has been updated to skip registrations without a student, enhancing the method's robustness. This change was implemented in commit `bef30f9751de0913143e8cb28cc0088264052261`.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java
  • src/main/java/de/tum/cit/aet/artemis/exam/service/ExamService.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
📚 Learning: 2025-09-15T11:18:26.439Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:13-16
Timestamp: 2025-09-15T11:18:26.439Z
Learning: In ExamRoomDistributionService.distributeRegisteredStudents method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, the team has decided not to use Transactional annotation despite multiple repository operations, based on human reviewer consultation.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java
  • src/main/java/de/tum/cit/aet/artemis/exam/service/ExamService.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/dto/ExamUserDTO.java
📚 Learning: 2025-09-25T20:48:13.391Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/test/java/de/tum/cit/aet/artemis/exam/test_repository/ExamRoomTestRepository.java:18-34
Timestamp: 2025-09-25T20:48:13.391Z
Learning: In ExamRoomTestRepository JPQL queries in src/test/java/de/tum/cit/aet/artemis/exam/test_repository/ExamRoomTestRepository.java, CTE (Common Table Expression) syntax with bare attribute names like `roomNumber`, `name`, `createdDate` inside the WITH clause works correctly without requiring entity aliases, confirmed working by SamuelRoettgermann in their Artemis/Hibernate setup.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java
📚 Learning: 2025-06-17T12:31:09.178Z
Learnt from: jfr2102
Repo: ls1intum/Artemis PR: 10983
File: src/main/java/de/tum/cit/aet/artemis/exercise/repository/StudentParticipationRepository.java:110-126
Timestamp: 2025-06-17T12:31:09.178Z
Learning: The query `findByExamIdWithEagerLatestLegalSubmissionsRatedResultAndIgnoreTestRunParticipation` in StudentParticipationRepository fetches all rated results (not just the latest) because the second correction round feature requires access to multiple assessment results per submission for proper correction round management.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java
📚 Learning: 2025-09-18T20:55:38.115Z
Learnt from: marlonnienaber
Repo: ls1intum/Artemis PR: 11350
File: src/main/java/de/tum/cit/aet/artemis/tutorialgroup/repository/TutorialGroupRepository.java:145-168
Timestamp: 2025-09-18T20:55:38.115Z
Learning: In tutorial groups, every TutorialGroup is guaranteed to have a teachingAssistant (non-null constraint), so teaching assistant associations don't require LEFT JOINs in JPQL queries. Only optional associations like tutorialGroupSchedule and tutorialGroupChannel need LEFT JOINs.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java
📚 Learning: 2025-09-25T20:43:41.712Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/web/ExamRoomDistributionResource.java:62-78
Timestamp: 2025-09-25T20:43:41.712Z
Learning: In the ExamRoomDistributionService.distributeRegisteredStudents method in src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java, ExamRoom entities are shared resources that are dynamically assigned to exams through the ExamRoomExamAssignment join table. Rooms don't "belong" to exams until the distribution process creates these assignments. The method first clears existing assignments for the exam, then creates new ones for the provided room IDs.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java
  • src/main/java/de/tum/cit/aet/artemis/exam/service/ExamService.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
📚 Learning: 2025-09-13T15:47:08.214Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRoomExamAssignmentRepository.java:21-23
Timestamp: 2025-09-13T15:47:08.214Z
Learning: Spring Data JPA can resolve nested properties in derived query method names. For example, if an entity has a field `Exam exam`, a method named `deleteAllByExamId(long examId)` will correctly resolve to `exam.id` even without a direct `examId` field. Spring Data first looks for direct field matches, then tries nested property paths when direct matches aren't found. This is standard Spring Data JPA behavior and should not be flagged as incorrect.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java
📚 Learning: 2025-09-20T16:43:32.823Z
Learnt from: MoritzSpengler
Repo: ls1intum/Artemis PR: 11382
File: src/main/java/de/tum/cit/aet/artemis/quiz/service/QuizQuestionProgressService.java:130-137
Timestamp: 2025-09-20T16:43:32.823Z
Learning: The findAllDueQuestions method exists in QuizQuestionRepository and accepts Set<Long> ids, Long courseId, and Pageable parameters, returning Page<QuizQuestion>. The method has a Query annotation that filters by courseId, isOpenForPractice = TRUE, and excludes questions with IDs in the provided set using NOT IN.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java
  • src/main/java/de/tum/cit/aet/artemis/exam/service/ExamService.java
📚 Learning: 2025-09-20T16:43:32.823Z
Learnt from: MoritzSpengler
Repo: ls1intum/Artemis PR: 11382
File: src/main/java/de/tum/cit/aet/artemis/quiz/service/QuizQuestionProgressService.java:130-137
Timestamp: 2025-09-20T16:43:32.823Z
Learning: The findAllDueQuestions method exists in QuizQuestionRepository and accepts Set<Long> ids, Long courseId, and Pageable parameters, returning Page<QuizQuestion>. This method is properly implemented and available for use in QuizQuestionProgressService.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.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/exam/service/ExamService.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamResource.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/exam/service/ExamService.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
📚 Learning: 2025-09-25T20:28:36.905Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/domain/ExamUser.java:16-17
Timestamp: 2025-09-25T20:28:36.905Z
Learning: In the Artemis codebase, ExamUser entity uses ExamSeatDTO as a transient field for performance reasons. SamuelRoettgermann tested domain value objects but they caused 60x slower performance. This architectural exception is approved by maintainers due to significant performance benefits and Artemis naming convention requirements.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/dto/ExamUserDTO.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/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamResource.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/main/java/de/tum/in/www1/artemis/web/rest/StudentExamResource.java:329-332
Timestamp: 2024-06-10T19:44:09.116Z
Learning: The error message for an already abandoned exam in `submitStudentExam` method of `StudentExamResource.java` does not need to include the student exam ID as it is already included in the error logging.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.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/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamResource.java
📚 Learning: 2024-10-14T10:30:20.109Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/main/java/de/tum/in/www1/artemis/service/exam/StudentExamService.java:295-303
Timestamp: 2024-10-14T10:30:20.109Z
Learning: The `abandonStudentExam` method in `StudentExamService` should not include a null check for the `studentExam` parameter as per the project's coding practices. It is expected that the `studentExam` will never be null at this point in the code, and a `NullPointerException` would indicate a significant issue elsewhere in the codebase.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: valentin-boehm
Repo: ls1intum/Artemis PR: 7384
File: src/main/java/de/tum/in/www1/artemis/web/rest/StudentExamResource.java:892-892
Timestamp: 2024-06-10T19:44:09.116Z
Learning: Valentin-boehm has indicated that including detailed error messages for self-explanatory exceptions such as a BadRequestException when a student exam is already submitted or abandoned is not necessary in the context of `StudentExamResource.java`.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.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/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamResource.java
📚 Learning: 2025-10-20T17:55:26.514Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11514
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomService.java:504-510
Timestamp: 2025-10-20T17:55:26.514Z
Learning: In ExamRoomService.applyXSpaceAndYSpaceFilter (src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomService.java), the xSpace and ySpace parameters intentionally represent exclusive minimums. Seats must be strictly MORE than these distances apart (using <= comparison to reject equal distances). This ensures no seats are placed at exactly the threshold distance.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.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/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
📚 Learning: 2025-09-22T09:02:57.726Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomService.java:315-321
Timestamp: 2025-09-22T09:02:57.726Z
Learning: The createdDate field in ExamRoom entities is non-null as it's required by the database schema, so null-safe comparators are not needed when comparing ExamRoom creation dates.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.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/exam/web/ExamUserResource.java
📚 Learning: 2025-09-25T22:36:36.450Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11419
File: src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java:191-191
Timestamp: 2025-09-25T22:36:36.450Z
Learning: SamuelRoettgermann uses crude/temporary implementations during early development stages for testing and validation purposes, acknowledging they are not production-ready but helpful for confirming functionality works as expected.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
📚 Learning: 2025-09-15T11:21:15.983Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomDistributionService.java:72-79
Timestamp: 2025-09-15T11:21:15.983Z
Learning: SamuelRoettgermann prefers iterative development approach - initial implementations should be working starting points rather than full-fledged, finished implementations. Optimization and robustness improvements can be added later.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
📚 Learning: 2024-10-20T18:37:45.365Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 9303
File: src/main/java/de/tum/in/www1/artemis/service/exam/StudentExamService.java:296-300
Timestamp: 2024-10-20T18:37:45.365Z
Learning: When reviewing code changes in `StudentExamService.saveSubmission`, if the PR aims to improve readability without changing logic, avoid suggesting changes that alter logic, such as adding exceptions in the default case of switch statements.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
📚 Learning: 2024-10-08T15:35:42.972Z
Learnt from: magaupp
Repo: ls1intum/Artemis PR: 8802
File: src/main/resources/templates/rust/exercise/src/context.rs:1-1
Timestamp: 2024-10-08T15:35:42.972Z
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/exam/web/ExamUserResource.java
📚 Learning: 2025-09-22T08:53:47.961Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11378
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomService.java:412-422
Timestamp: 2025-09-22T08:53:47.961Z
Learning: SamuelRoettgermann prefers trusting input data quality over defensive programming for floating-point coordinate grouping in ExamRoomService, reasoning that data from the same source/script should be consistent without precision errors.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: JohannesStoehr
Repo: ls1intum/Artemis PR: 0
File: :0-0
Timestamp: 2024-06-10T19:44:09.116Z
Learning: Admins are included in the `isAtLeastTutor` check, and unauthenticated users cannot access the `CourseTutorialGroupsComponent`.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamUserResource.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/exam/web/ExamUserResource.java
  • src/main/java/de/tum/cit/aet/artemis/exam/web/ExamResource.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/exam/web/ExamUserResource.java
📚 Learning: 2024-06-10T19:44:09.116Z
Learnt from: jakubriegel
Repo: ls1intum/Artemis PR: 8050
File: src/test/java/de/tum/in/www1/artemis/plagiarism/PlagiarismUtilService.java:62-66
Timestamp: 2024-06-10T19:44:09.116Z
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/exam/web/ExamUserResource.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/exam/web/ExamResource.java
📚 Learning: 2025-08-15T00:59:12.716Z
Learnt from: SamuelRoettgermann
Repo: ls1intum/Artemis PR: 11111
File: src/main/java/de/tum/cit/aet/artemis/exam/service/ExamRoomService.java:15-17
Timestamp: 2025-08-15T00:59:12.716Z
Learning: In ExamRoomService.java, Joda-Time is used specifically for duration formatting because the user needs a formatter that always includes millisecond precision, which they found difficult or impossible to achieve with java.time Duration formatting.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/exam/dto/ExamUserDTO.java
⏰ 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). (6)
  • GitHub Check: Build and Push Docker Image / Build linux/arm64 Docker Image for ls1intum/artemis
  • GitHub Check: Build and Push Docker Image / Build linux/amd64 Docker Image for ls1intum/artemis
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: client-tests
🔇 Additional comments (4)
src/main/java/de/tum/cit/aet/artemis/exam/web/ExamResource.java (1)

522-522: Access control broadened to support attendance checker feature.

The annotation change from @EnforceAtLeastInstructor to @EnforceAtLeastTutor intentionally lowers the access requirement, allowing tutors (teaching assistants) to retrieve active exams. This aligns with the PR's attendance-checker functionality where exam supervisors need visibility into active exams.

src/main/java/de/tum/cit/aet/artemis/exam/service/ExamService.java (1)

1485-1489: Service layer correctly updated to match repository method rename.

The method call has been updated from findAllActiveExamsInCoursesWhereInstructor to findAllActiveExamsInCoursesWhereAtLeastTutor, maintaining consistency with the repository layer changes. The date range logic and parameters remain unchanged.

src/main/java/de/tum/cit/aet/artemis/exam/repository/ExamRepository.java (1)

95-114: Repository method correctly broadened to include tutors and editors.

The changes properly implement "at least tutor" access:

  • JavaDoc updated to reflect the broadened access level
  • JPQL query expanded to check instructorGroupName, editorGroupName, AND teachingAssistantGroupName using OR logic
  • Method renamed to findAllActiveExamsInCoursesWhereAtLeastTutor for clarity

The query correctly matches exams where the user belongs to any of the three role groups, maintaining the date range filtering and pagination.

src/main/java/de/tum/cit/aet/artemis/exam/dto/ExamUserDTO.java (1)

12-27: Record reformatting keeps DTO semantics intact

Layout/formatter changes only; the record structure, validation annotations, and field order are preserved and align with the DTO guidelines (record, primitive/String fields, minimal surface).

Also applies to: 29-29

Copy link
Member

@anian03 anian03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS3, loading signatures as a tutor doesnt work. Otherwise all works as expected. Will need to update the image path though

@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 17m 5s 307ms
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 164ms
e2e/exam/test-exam/TestExamStudentExams.spec.ts
ts.Test Exam - student exams › Check exam participants and their submissions › Search for a student in exams❌ failure6m 8s 492ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 33s 546ms

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!) core Pull requests that affect the corresponding module exam Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!) tests

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

4 participants