Skip to content

Conversation

MoritzSpengler
Copy link
Contributor

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

Motivation and Context

Students can choose the settings for the quiz training mode when they first enter the mode. We want students to be able to change the settings for the quiz training mode afterwards in the user settings.

Description

I added the quiz training settings component and a service class to display the quiz training settings in the user settings. I also added a REST API and repository method that fetches the current settings from the database.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 2 Students
  • 1 Programming Exercise with Complaints enabled
  1. Log in to Artemis
  2. Navigate to Course Administration
  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

Class/File Line Coverage Confirmation (assert/expect)
quiz-training-settings.component.ts 100%
quiz-training-settings-service.ts 100%

Screenshots

Summary by CodeRabbit

  • New Features

    • Added a Quiz Training section in User Settings with a toggle to show/hide your name on the Quiz Training leaderboard.
    • New navigation link to access Quiz Training settings.
    • Settings load and save automatically; an info message appears if no settings exist yet.
    • Added English and German translations for the new UI.
  • Tests

    • Added unit tests for the settings service and component.

@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Oct 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!) core Pull requests that affect the corresponding module quiz Pull requests that affect the corresponding module labels Oct 13, 2025
Copy link

End-to-End (E2E) Test Results Summary

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

@MoritzSpengler MoritzSpengler marked this pull request as ready for review October 13, 2025 14:59
@MoritzSpengler MoritzSpengler requested review from a team and krusche as code owners October 13, 2025 14:59
Copy link
Contributor

coderabbitai bot commented Oct 13, 2025

Walkthrough

Introduces a user-facing “Quiz Training” settings feature with a leaderboard visibility toggle. Adds a backend GET/PUT API for leaderboard settings, a repository query to fetch the flag, renames a DTO field (shownInLeaderboardshowInLeaderboard), and implements the Angular service, component, routing, tests, and i18n strings.

Changes

Cohort / File(s) Summary
Backend DTO rename
src/main/java/de/tum/cit/aet/artemis/quiz/dto/LeaderboardSettingDTO.java
Renames record component from shownInLeaderboard to showInLeaderboard; type and nullability unchanged.
Backend repository
src/main/java/de/tum/cit/aet/artemis/quiz/repository/QuizTrainingLeaderboardRepository.java
Adds Optional<Boolean> getShowInLeaderboard(long userId); minor whitespace change in existing update query.
Backend REST resource
src/main/java/de/tum/cit/aet/artemis/quiz/web/QuizTrainingResource.java
Injects QuizTrainingLeaderboardRepository; adds GET /api/quiz/leaderboard-settings; replaces usages of shownInLeaderboard() with showInLeaderboard(); constructor updated.
Frontend DTO & service
src/main/webapp/app/core/user/settings/quiz-training-settings/leaderboard-settings-dto.ts, .../quiz-training-settings-service.ts, .../quiz-training-settings-service.spec.ts
Adds LeaderboardSettingsDTO (showInLeaderboard?: boolean), QuizTrainingSettingsService with GET/PUT api/quiz/leaderboard-settings, and unit tests for the service.
Frontend component & tests
src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.ts, .../quiz-training-settings.component.html, .../quiz-training-settings.component.spec.ts
Adds standalone QuizTrainingSettingsComponent, HTML toggle fragment bound to isVisibleInLeaderboard, load/update flows calling the service, and comprehensive unit tests for component behavior and error handling.
Routing & navigation
src/main/webapp/app/core/user/settings/user-settings-container/user-settings-container.component.html, src/main/webapp/app/core/user/settings/user-settings.route.ts
Adds navigation link to "quiz-training" and a child route that lazy-loads the settings component with pageTitle artemisApp.userSettings.categories.QUIZ_TRAINING_SETTINGS.
i18n additions
src/main/webapp/i18n/en/userSettings.json, src/main/webapp/i18n/de/userSettings.json
Adds QUIZ_TRAINING_SETTINGS category and quizTrainingSettings translations (labels, tooltip, info, visit message, update success) for EN/DE.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant FE as QuizTrainingSettingsComponent
    participant Svc as QuizTrainingSettingsService
    participant API as QuizTrainingResource
    participant Repo as QuizTrainingLeaderboardRepository

    User->>FE: open Quiz Training settings
    FE->>Svc: getSettings()
    Svc->>API: GET /api/quiz/leaderboard-settings
    API->>Repo: getShowInLeaderboard(userId)
    Repo-->>API: Optional<Boolean>
    API-->>Svc: 200 { showInLeaderboard }
    Svc-->>FE: HttpResponse<DTO>
    FE->>FE: bind toggle to showInLeaderboard

    rect rgba(219,237,255,0.3)
    User->>FE: toggle visibility
    FE->>Svc: updateSettings({ showInLeaderboard })
    Svc->>API: PUT /api/quiz/leaderboard-settings { showInLeaderboard }
    API->>Repo: persist change
    API-->>Svc: 200 { showInLeaderboard }
    Svc-->>FE: HttpResponse<DTO>
    FE->>User: show success message
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title clearly indicates that it adds quiz training settings to the user settings area and prefixes the relevant feature context, making it specific and directly tied to the main change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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 feature/quiz-exercises/add-quiz-training-to-user-settings

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: 2

🧹 Nitpick comments (4)
src/main/java/de/tum/cit/aet/artemis/quiz/repository/QuizTrainingLeaderboardRepository.java (1)

74-79: Consider removing DISTINCT for clarity.

The DISTINCT keyword is likely unnecessary since there should be at most one QuizTrainingLeaderboard entry per userId. While not harmful, removing it would make the intent clearer and potentially improve query performance slightly.

Apply this diff if there's truly a 1:1 relationship between user and showInLeaderboard:

 @Query("""
-            SELECT DISTINCT qtl.showInLeaderboard
+            SELECT qtl.showInLeaderboard
             FROM QuizTrainingLeaderboard qtl
             WHERE qtl.user.id = :userId
         """)
 Optional<Boolean> getShowInLeaderboard(@Param("userId") long userId);
src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.ts (1)

31-37: Add error handling to loadSettings.

The loadSettings() method lacks error handling. If the API call fails, isVisibleInLeaderboard remains undefined with no user feedback. While this triggers the info alert, it's unclear whether it's a loading error or intentional behavior.

Apply this diff to add error handling:

 private loadSettings(): void {
-    this.quizService.getSettings().subscribe((response) => {
-        if (response.body) {
-            this.isVisibleInLeaderboard = response.body.showInLeaderboard;
-        }
-    });
+    this.quizService.getSettings().subscribe({
+        next: (response) => {
+            if (response.body) {
+                this.isVisibleInLeaderboard = response.body.showInLeaderboard;
+            }
+        },
+        error: (error) => {
+            onError(this.alertService, error);
+        },
+    });
 }
src/main/java/de/tum/cit/aet/artemis/quiz/dto/LeaderboardSettingDTO.java (1)

8-8: All code references updated; no shownInLeaderboard occurrences remain.

  • Update Javadoc comments still referring to the old name.
src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings-service.ts (1)

10-16: Prefer single quotes for simple strings without interpolation.

Lines 11 and 15 use template literals (backticks) for simple URL strings without any interpolation. Consider using single quotes for consistency with the coding guidelines.

Apply this diff:

     getSettings(): Observable<HttpResponse<LeaderboardSettingsDTO>> {
-        return this.http.get(`api/quiz/leaderboard-settings`, { observe: 'response' });
+        return this.http.get('api/quiz/leaderboard-settings', { observe: 'response' });
     }

     updateSettings(settings: LeaderboardSettingsDTO): Observable<HttpResponse<LeaderboardSettingsDTO>> {
-        return this.http.put(`api/quiz/leaderboard-settings`, settings, { observe: 'response' });
+        return this.http.put('api/quiz/leaderboard-settings', settings, { observe: 'response' });
     }

As per coding guidelines

📜 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 abd58e5 and dfd0553.

📒 Files selected for processing (13)
  • src/main/java/de/tum/cit/aet/artemis/quiz/dto/LeaderboardSettingDTO.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/quiz/repository/QuizTrainingLeaderboardRepository.java (1 hunks)
  • src/main/java/de/tum/cit/aet/artemis/quiz/web/QuizTrainingResource.java (5 hunks)
  • src/main/webapp/app/core/user/settings/quiz-training-settings/leaderboard-settings-dto.ts (1 hunks)
  • src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings-service.spec.ts (1 hunks)
  • src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings-service.ts (1 hunks)
  • src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.html (1 hunks)
  • src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.spec.ts (1 hunks)
  • src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.ts (1 hunks)
  • src/main/webapp/app/core/user/settings/user-settings-container/user-settings-container.component.html (1 hunks)
  • src/main/webapp/app/core/user/settings/user-settings.route.ts (1 hunks)
  • src/main/webapp/i18n/de/userSettings.json (1 hunks)
  • src/main/webapp/i18n/en/userSettings.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
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/quiz/repository/QuizTrainingLeaderboardRepository.java
  • src/main/java/de/tum/cit/aet/artemis/quiz/dto/LeaderboardSettingDTO.java
  • src/main/java/de/tum/cit/aet/artemis/quiz/web/QuizTrainingResource.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/core/user/settings/quiz-training-settings/leaderboard-settings-dto.ts
  • src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.ts
  • src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings-service.spec.ts
  • src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings-service.ts
  • src/main/webapp/app/core/user/settings/user-settings.route.ts
  • src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.spec.ts
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/core/user/settings/quiz-training-settings/quiz-training-settings.component.html
  • src/main/webapp/app/core/user/settings/user-settings-container/user-settings-container.component.html
src/main/webapp/i18n/de/**/*.json

⚙️ CodeRabbit configuration file

German language translations should be informal (dutzen) and should never be formal (sietzen). So the user should always be addressed with "du/dein" and never with "sie/ihr".

Files:

  • src/main/webapp/i18n/de/userSettings.json
🧠 Learnings (3)
📓 Common learnings
Learnt from: MoritzSpengler
PR: ls1intum/Artemis#11345
File: src/main/java/de/tum/cit/aet/artemis/quiz/service/QuizTrainingLeaderboardService.java:128-141
Timestamp: 2025-09-21T11:51:17.945Z
Learning: In QuizTrainingLeaderboardService, prefilling leaderboardName with user.getFirstName() during leaderboard entry creation is a deliberate design choice. Privacy protection is handled at the display level rather than initialization level.
📚 Learning: 2025-09-05T15:13:32.171Z
Learnt from: MoritzSpengler
PR: ls1intum/Artemis#11345
File: src/main/java/de/tum/cit/aet/artemis/quiz/repository/QuizTrainingLeaderboardRepository.java:22-23
Timestamp: 2025-09-05T15:13:32.171Z
Learning: The derived query method name `findByLeagueAndCourseIdOrderByScoreDescUserAscId` in QuizTrainingLeaderboardRepository correctly references the `user` entity field directly in the OrderBy clause, not requiring `userId`. Spring Data JPA supports sorting by entity references directly in derived query method names.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/quiz/repository/QuizTrainingLeaderboardRepository.java
📚 Learning: 2025-09-05T15:11:31.588Z
Learnt from: MoritzSpengler
PR: ls1intum/Artemis#11345
File: src/main/java/de/tum/cit/aet/artemis/quiz/domain/QuizTrainingLeaderboard.java:10-11
Timestamp: 2025-09-05T15:11:31.588Z
Learning: In the QuizTrainingLeaderboard domain class, validation is handled by the service class logic rather than using bean validation annotations at the entity level.

Applied to files:

  • src/main/java/de/tum/cit/aet/artemis/quiz/web/QuizTrainingResource.java
🧬 Code graph analysis (4)
src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.ts (1)
src/main/webapp/app/core/user/settings/quiz-training-settings/leaderboard-settings-dto.ts (1)
  • LeaderboardSettingsDTO (1-3)
src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings-service.spec.ts (1)
src/main/webapp/app/core/user/settings/quiz-training-settings/leaderboard-settings-dto.ts (1)
  • LeaderboardSettingsDTO (1-3)
src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings-service.ts (1)
src/main/webapp/app/core/user/settings/quiz-training-settings/leaderboard-settings-dto.ts (1)
  • LeaderboardSettingsDTO (1-3)
src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.spec.ts (1)
src/main/webapp/app/core/user/settings/quiz-training-settings/leaderboard-settings-dto.ts (1)
  • LeaderboardSettingsDTO (1-3)
⏰ 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). (5)
  • GitHub Check: server-tests
  • GitHub Check: client-tests
  • 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: Analyse
🔇 Additional comments (9)
src/main/webapp/app/core/user/settings/quiz-training-settings/leaderboard-settings-dto.ts (1)

1-3: LGTM!

The DTO structure is simple and correct. The showInLeaderboard property name aligns with the backend LeaderboardSettingDTO field.

src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.html (1)

1-32: LGTM!

The template correctly uses modern Angular control flow syntax (@if/@else), properly implements two-way binding with ngModel, and consistently applies i18n directives for all user-facing text. The conditional rendering logic for showing the toggle vs. the info alert is well structured.

src/main/webapp/i18n/en/userSettings.json (1)

230-238: LGTM!

The i18n keys for Quiz Training settings are well-structured, follow existing naming conventions, and provide clear, informative text for users. The key hierarchy is logical and consistent with other settings sections.

src/main/webapp/i18n/de/userSettings.json (1)

230-238: LGTM! German translations follow the informal tone guideline.

All strings correctly use the informal address (du/dein) as required by the coding guidelines for German translations.

src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings-service.spec.ts (1)

1-48: LGTM! Well-structured test suite with proper HTTP testing.

The test suite follows Angular testing best practices:

  • Uses modern provideHttpClient and provideHttpClientTesting
  • Includes proper cleanup with httpMock.verify() in afterEach
  • Tests both GET and PUT operations with appropriate assertions
src/main/webapp/app/core/user/settings/quiz-training-settings/quiz-training-settings.component.spec.ts (1)

1-139: LGTM! Comprehensive test coverage with proper async handling.

The test suite thoroughly covers all component functionality:

  • Loading and displaying settings
  • Toggling leaderboard visibility
  • Error handling with onError utility
  • DOM interactions and state synchronization
  • Edge case: no settings available

All tests use appropriate Angular testing patterns with fakeAsync and proper fixture management.

src/main/java/de/tum/cit/aet/artemis/quiz/web/QuizTrainingResource.java (3)

7-7: LGTM! Proper dependency injection.

The new repository dependency is correctly injected via constructor following the coding guidelines.

Also applies to: 43-43, 68-80


166-166: LGTM! Field name updated consistently.

The DTO method call is correctly updated from shownInLeaderboard() to showInLeaderboard(), aligning with the DTO field rename across the codebase.

Also applies to: 191-191


196-216: LGTM! New GET endpoint follows REST best practices.

The implementation is correct:

  • Properly documented with Javadoc
  • Uses appropriate security annotation (@EnforceAtLeastStudent)
  • Returns a DTO with nullable Boolean to indicate "not set" state
  • Consistent with the existing PUT endpoint pattern at line 160

@github-project-automation github-project-automation bot moved this from Work In Progress to Ready For Review in Artemis Development Oct 13, 2025
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 (1)
src/main/webapp/i18n/en/userSettings.json (1)

231-239: Minor copy polish and i18n parity

  • Add missing period to the end of leaderboardVisibilityTooltip:
-    "leaderboardVisibilityTooltip": "Determines if your name and results are shown in the Quiz Training leaderboard",
+    "leaderboardVisibilityTooltip": "Determines if your name and results are shown in the Quiz Training leaderboard.",
  • Optional: align label/tooltip wording (label mentions “name” only vs. tooltip “name and results”).
  • Confirm that “name” refers to the displayed identifier to avoid confusion.
📜 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 dfd0553 and b28606d.

📒 Files selected for processing (4)
  • src/main/webapp/app/core/user/settings/user-settings-container/user-settings-container.component.html (1 hunks)
  • src/main/webapp/app/core/user/settings/user-settings.route.ts (1 hunks)
  • src/main/webapp/i18n/de/userSettings.json (2 hunks)
  • src/main/webapp/i18n/en/userSettings.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/webapp/i18n/de/userSettings.json
  • src/main/webapp/app/core/user/settings/user-settings-container/user-settings-container.component.html
🧰 Additional context used
📓 Path-based instructions (1)
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/core/user/settings/user-settings.route.ts
🧠 Learnings (1)
📓 Common learnings
Learnt from: MoritzSpengler
PR: ls1intum/Artemis#11345
File: src/main/java/de/tum/cit/aet/artemis/quiz/service/QuizTrainingLeaderboardService.java:128-141
Timestamp: 2025-09-21T11:51:17.945Z
Learning: In QuizTrainingLeaderboardService, prefilling leaderboardName with user.getFirstName() during leaderboard entry creation is a deliberate design choice. Privacy protection is handled at the display level rather than initialization level.
⏰ 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). (9)
  • 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: Build .war artifact
  • GitHub Check: client-tests
  • GitHub Check: bean-instantiation-check
  • GitHub Check: Analyse
  • GitHub Check: client-style
  • GitHub Check: server-style
  • GitHub Check: server-tests
🔇 Additional comments (2)
src/main/webapp/app/core/user/settings/user-settings.route.ts (1)

115-121: LGTM! Route configuration follows best practices.

The quiz-training route is properly configured with:

  • Lazy loading for optimal performance
  • Translation key for i18n compliance
  • Consistent structure with other user settings routes
  • Appropriate authorization (inherits USER authority from parent route)

The previous review concern about using a hardcoded pageTitle has been addressed—the code now correctly uses the translation key artemisApp.userSettings.categories.QUIZ_TRAINING_SETTINGS.

As per coding guidelines.

src/main/webapp/i18n/en/userSettings.json (1)

147-149: Categories added: looks good; verify i18n parity and usage.

GLOBAL_NOTIFICATIONS and QUIZ_TRAINING_SETTINGS entries look consistent with existing naming. Please ensure:

  • The same keys exist in the German locale with translations.
  • The UI routes/menus use these exact category keys (no divergence from NOTIFICATION_SETTINGS).

Copy link

End-to-End (E2E) Test Results Summary

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

Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report205 ran200 passed3 skipped2 failed1h 13m 58s 449ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exam/test-exam/TestExamParticipation.spec.ts
ts.Test exam participation › Early Hand-in › Using exercise overview to navigate within exam❌ failure3m 37s 807ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure2m 35s 100ms

Copy link
Contributor

@KonstiAnon KonstiAnon left a comment

Choose a reason for hiding this comment

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

code

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 but I've left a few questions

log.debug("REST request to get leaderboard settings");
User user = userRepository.getUserWithGroupsAndAuthorities();
Optional<Boolean> showInLeaderboardOptional = quizTrainingLeaderboardRepository.getShowInLeaderboard(user.getId());
Boolean showInLeaderboard = showInLeaderboardOptional.orElse(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

why is the value not false when nothing is found. I assume it's a reasonable default to not show them if they have not opted in.

@Component({
selector: 'jhi-quiz-training-settings',
templateUrl: './quiz-training-settings.component.html',
standalone: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

standalone is the default from angular 19 onwards

selector: 'jhi-quiz-training-settings',
templateUrl: './quiz-training-settings.component.html',
standalone: true,
imports: [TranslateDirective, FormsModule, NgbTooltipModule, FontAwesomeModule],
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need the entire font awesome module and the entire tooltip module?

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 quiz Pull requests that affect the corresponding module ready for review server Pull requests that update Java code. (Added Automatically!)

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

3 participants