Skip to content

Conversation

@SamuelRoettgermann
Copy link
Contributor

@SamuelRoettgermann SamuelRoettgermann commented Jan 27, 2026

Summary

Show unassigned students in a separate "No Room Set" section.

Checklist

General

Server

  • 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 documented the Java code using JavaDoc style.

Motivation and Context

When using the iPad attendance checker app, students who were not assigned a room or seat would not be shown in the iPad app.

Description

Now, instead of filtering out unused students, it sets the room and seat fields to reasonable default texts. The iPad app only supports English, so a translation is not required.

Steps for Testing - if you do have an iPad

Prerequisites:

  1. Log in to Artemis
  2. Navigate to your exam's exam management
  3. Check the iPad app to see if it shows all students who do not have a room/seat assignment in a special "room" called "No Room set" or something similar to that.
  4. Distribute to some rooms using the Distribute button (you can select more rooms than are needed).
  5. Repeat step 3, but this time make sure no student is inside that "No Room Set" room anymore, and that room should also not be displayed anymore
  6. Manually add some more exam participants to which you don't assign a location
  7. Repeat step 3

Steps for Testing - if you don't have an iPad

Prerequisites:

  1. Log in to Artemis
  2. Navigate to your exam's exam management
  3. Check the return value when making a GET request to <artemis-server>/api/exam/courses/{courseId}/exams/{examId}/attendance-checker-information. Check that it contains the students without seat assignments with "No Room set"/"No Seat set".
  4. Distribute to some rooms using the Distribute button (you can select more rooms than are needed).
  5. Repeat step 3, but this time make sure no student has the "No Room set"/"No Seat set" text
  6. Manually add some more exam participants to which you don't assign a location
  7. Repeat step 3

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

Server

Class/File Line Coverage Lines
AttendanceCheckerAppExamInformationDTO.java 90.38% 132

Last updated: 2026-01-27 14:29:01 UTC

Screenshots

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of exam user room and seat assignments for both legacy and modern data formats, ensuring accurate attendance information retrieval.
    • Fixed exam user distribution mapping to streamline data processing.
  • Tests

    • Added comprehensive test coverage for exam room distribution scenarios, including partial student registration with automatic distribution.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Walkthrough

The changes refactor the attendance checker DTO to distinguish between legacy and modern data paths for exam user location handling. The distribution logic is simplified by directly mapping exam users instead of using intermediate filtering. Test files are updated to reflect renamed distribution methods from "modern" to "automatic," with helper methods generalized to accept configurable student counts.

Changes

Cohort / File(s) Summary
DTO Logic Refactoring
src/main/java/de/tum/cit/aet/artemis/exam/dto/room/AttendanceCheckerAppExamInformationDTO.java
Reworked ExamUserLocationDTO.plannedFrom to handle legacy vs. modern data paths separately; legacy returns null room ID with fallback display strings, modern uses transient IDs. Removed intermediate set filtering in AttendanceCheckerAppExamInformationDTO.from, now directly maps exam users to DTO objects.
Test Updates & Generalization
src/test/java/de/tum/cit/aet/artemis/exam/ExamRoomDistributionIntegrationTest.java
Renamed test methods from "ModernDistribution" to "AutomaticDistribution"; generalized uploadFourRoomsAndDistributeStudentsInExam1() to accept configurable student count parameter. Added new test case for automatic distribution with unseated students and updated test data assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately summarizes the main change: enabling the attendance checker iPad app to display unassigned students, which is reflected in both the DTO modifications and new test coverage.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 bugfix/exam-mode/ipad-attendance-checker-show-unseated-students

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.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) exam Pull requests that affect the corresponding module labels Jan 27, 2026
@github-actions
Copy link

@SamuelRoettgermann Test coverage has been automatically updated in the PR description.

@helios-aet helios-aet bot temporarily deployed to artemis-test4.artemis.cit.tum.de January 27, 2026 14:59 Inactive
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅Skipped ⚠️FailedTime ⏱
End-to-End (E2E) Test Report223 ran222 passed1 skipped0 failed1h 23m 25s 836ms
TestResultTime ⏱
No test annotations available

if (isLegacy) {
return new ExamUserLocationDTO(
null,
StringUtils.hasText(examUser.getPlannedRoom()) ? examUser.getPlannedRoom() : "No Room set",
Copy link

Choose a reason for hiding this comment

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

Internationalization is not possible this way. Why not use null or at least add a flag that clearly marks this student as unassigned?

Copy link
Contributor Author

@SamuelRoettgermann SamuelRoettgermann Jan 27, 2026

Choose a reason for hiding this comment

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

As of right now the iPad attendance checker app only supports English, and it is not currently planned to support more languages.

The reason why we chose to do it this way, instead of directly returning null, is because returning null causes older iPad versions to crash, because they expect the fields to always be non-null. Over the past few weeks we had two exams, and in both cases had some issues because many of the iPads were outdated, both the iOS version as well as the attendance checker app version itself. This means we can't roll out changes that would break backwards-compatibility.

For these reasons, we decided not to return A) a (translated) translation-key, or B) null.

An extra flag might work, but it'd also run into some backwards-compatibility issues.

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 TS4 with the iPad app. All students were correctly returned, including those without a room/seat assignment. They were grouped into a separate "room" called "No room set".

Code also LGTM, hardcoding english strings is fine here as we don't support any other languages in the iPad app (and it's the only place this is used). The web app does not show this string

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

Labels

exam Pull requests that affect the corresponding module ready for review server Pull requests that update Java code. (Added Automatically!) tests

Projects

Status: Work In Progress

Development

Successfully merging this pull request may close these issues.

5 participants