Skip to content

Conversation

SamuelRoettgermann
Copy link
Contributor

@SamuelRoettgermann SamuelRoettgermann commented Sep 12, 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.
  • I translated all newly inserted strings into English and German.

Client

  • I strictly followed the client coding and design guidelines.
  • I adapted integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I translated all newly inserted strings into English and German.

Motivation and Context

Right now we have an exam room management page where we can upload exam rooms, but we can't yet assign them to actual exams, but of course we need to do that to actually integrate them with the exams.

Description

This PR adds a POST endpoint for /api/exam/courses/{courseId}/exams/{examId}/distribute-registered-students to automatically distribute students over a selection of rooms.

For now it can only distribute via the default layout strategy.

It also adds an ID display for the exam rooms in the admin exam room overview. Reasons for that addition are that it's something that will very likely be needed in the future anyway to further inspect single rooms, but also because it makes testing this PR so much easier. The default capacity was added partly for the latter reason, and also because it's just interesting, probably even more interesting than the max capacity that was already displayed.

I also had to adapt some tests because as it turned out some of the rooms in the current real tumexam dataset have syntactical mistakes in some fixed layouts and I can't fix them (yet).

Steps for Testing

Prerequisites:

  • Postman, or an alternative way to manually perform a simple POST request (I will explain the procedure with Postman, if you use an alternative you'll need to configure it yourself)
  • 1 Admin (your own TUM account on TS3)
  • 1 exam with a few registered exam users (you can do that by adding artemis_test_user_200 and onwards to your exam. I would recommend adding them manually; trying to automate this just takes longer, I tried), or alternatively I have set up such an exam in my test course on TS3 with 40 registered students
  1. Log in to Artemis as instructor or admin and copy the Bearer token (check your Browser's dev tools for the authenticate request, and check the Response)
  2. In a new tab, navigate to the Exam Management for the exam from the prerequisites, and go to the students management page
  3. In Postman, create a new POST request, go to the "Authorization" tab, select "Bearer Token", and paste the token you just copied into the field that just popped up
  4. Set the POST request URL as {test-server}/api/exam/courses/{courseId}/exams/{examId}/distribute-registered-students. You can see the courseId and examId in the URL bar after you've completed step
  5. In a new tab navigate to "Server Administration" (top bar) -> "Exam Rooms"
  6. If the exam room page is empty, then you can upload either this zip file containing just 4 rooms, 2 of which have pretty low default capacities: four-rooms.zip, or this zip file containing (almost) all of the actual TUM exam rooms: rooms-master-no-broken-fixed-selection.zip
  7. In Postman, click on the Body tab, click on raw and JSON, and type in [ <room-id1>, <room-id2>, ... ], where the room-ids are the ids of those rooms you want to select for distribution to. For example it could look like so (after you've hit Send):
image
  1. Check that if the seating distribution was successful, that it sets the Room and Seat page on the "Student Management" page from step 2

Steps for Re-Testing

If you're retesting this, you can simply check that the "Delete all rooms" button on the admin's exam room management page was removed, which means it's currently no longer possible to quickly erase the room assignments in the student overview. The only way to do that now is to remove and re-add the students to the course.

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Client

Class/File Line Coverage Confirmation (assert/expect)
exam-rooms.component.ts 99.18%

Server

Class/File Line Coverage Confirmation (assert/expect)
ExamRoomDTO.java 100%
ExamRoomDistributionService.java 99%
ExamRoomService.java 78%
ExamResource.java 94%
ExamRoomDistributionResource.java 88%

Screenshots

The red encircled things are new:
image

This is the room and seat fields on the student exams management page I was talking about:
image

Summary by CodeRabbit

  • New Features

    • Distribute registered students across selected exam rooms via a new endpoint.
    • Admin overview now shows room IDs and default capacity, with sorting by ID and default capacity.
    • Validates selected room IDs and ensures they refer to the newest room versions.
  • UI Changes

    • Removed “Delete all exam rooms”; retained deletion of outdated/unused versions.
    • Reordered admin overview columns: ID, room number, name, building, default capacity, max capacity, layout strategies.
  • Documentation

    • Added/updated English and German translations for new errors, labels (ID, Default Capacity), and deletion wording.

… 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
LeZhen1105
LeZhen1105 previously approved these changes Oct 2, 2025
Copy link
Contributor

@LeZhen1105 LeZhen1105 left a comment

Choose a reason for hiding this comment

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

reapprove

@SamuelRoettgermann
Copy link
Contributor Author

Re-tested on TS3. Distribution works as expected correctly as before. Delete button is removed 🎊 nit: Breadcrumb at the top of the screen text (exam-rooms) is in kebab-case. For other pages use sentence case like "Course Management".
image Image

Oh wow, I never noticed that. Good catch. Yeah, I'll definitely fix that, however it doesn't really belong to this PR, as it did to #11111

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de October 2, 2025 16:50 Inactive
HawKhiem
HawKhiem previously approved these changes Oct 2, 2025
Copy link
Contributor

@HawKhiem HawKhiem 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, also code 👍

tobias-lippert
tobias-lippert previously approved these changes Oct 2, 2025
Copy link
Contributor

@tobias-lippert tobias-lippert left a comment

Choose a reason for hiding this comment

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

code lgtm, just one question

@SamuelRoettgermann SamuelRoettgermann moved this from Ready For Review to Developer Approved in Artemis Development Oct 2, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 3, 2025
Copy link

github-actions bot commented Oct 3, 2025

End-to-End (E2E) Test Results Summary

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

@SamuelRoettgermann SamuelRoettgermann moved this from Developer Approved to Maintainer Approved in Artemis Development Oct 3, 2025
@SamuelRoettgermann SamuelRoettgermann moved this from Maintainer Approved to Work In Progress in Artemis Development Oct 3, 2025
@SamuelRoettgermann SamuelRoettgermann moved this from Work In Progress to Maintainer Approved in Artemis Development Oct 3, 2025
Copy link

github-actions bot commented Oct 3, 2025

End-to-End (E2E) Test Results Summary

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

Copy link

github-actions bot commented Oct 3, 2025

End-to-End (E2E) Test Results Summary

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

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 ready to merge server Pull requests that update Java code. (Added Automatically!) tests
Projects
Status: Maintainer Approved
Development

Successfully merging this pull request may close these issues.

9 participants