Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programming exercises: Adjust translations for participation mode tooltips #9468

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

iyannsch
Copy link
Contributor

@iyannsch iyannsch commented Oct 13, 2024

Tip

Most basic functionality is already merged so this PR only includes the leftover review comments :)

Checklist

General

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.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).
  • I tested all changes and their related features with all corresponding user types on a test server configured with Gitlab and Jenkins.

Motivation and Context

As the amount of participation modes grow from Offline IDE and Online Editor to now also include the Online IDE, @bassner mentioned that he'd love a description for those options. Most basic functionality is already merged so this PR only includes the leftover review comments :)

Description

This PR adds tooltips to the three participations modes.

Steps for Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Navigate to a course
  3. Create or edit a programming exercise
  4. Verify that the participations modes have tooltips

Exam Mode Testing

Prerequisites:

  • 1 Instructor
  1. Log in to Artemis
  2. Navigate to a course
  3. Create or edit a programming exercise
  4. Verify that the participations modes have tooltips

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Performance Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

Screenshot 13 10 - 15 25

Summary by CodeRabbit

  • New Features
    • Introduced contextual help icons for "allowOfflineIde" and "allowOnlineEditor" checkboxes to enhance user experience.
    • Added detailed descriptions for IDE options in both English and German to improve clarity for users.

These updates aim to provide better guidance and usability for students interacting with programming exercises.

@iyannsch iyannsch self-assigned this Oct 13, 2024
@iyannsch iyannsch requested a review from a team as a code owner October 13, 2024 13:33
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Oct 13, 2024
Copy link

coderabbitai bot commented Oct 13, 2024

Walkthrough

This pull request introduces new descriptions for options related to online and offline IDEs in the internationalization JSON files for both German and English. Additionally, it modifies the HTML template of the programming exercise difficulty component by adding <jhi-help-icon> elements for contextual help regarding the "allowOfflineIde" and "allowOnlineEditor" options. The test setup for the component has been updated to include a shared component module.

Changes

File Path Change Summary
src/main/webapp/app/exercises/programming/manage/update/update-components/programming-exercise-difficulty.component.html Added <jhi-help-icon> components for contextual help on "allowOfflineIde" and "allowOnlineEditor" checkboxes.
src/main/webapp/i18n/de/programmingExercise.json, src/main/webapp/i18n/en/programmingExercise.json Added new descriptions for allowOnlineEditor, allowOfflineIde, and allowOnlineIde options in both DE and EN files.
src/test/javascript/spec/component/programming-exercise/update-components/programming-exercise-difficulty.component.spec.ts Modified test setup by adding ArtemisSharedComponentModule to the imports array.

Suggested labels

user interface, documentation

Suggested reviewers

  • edkaya
  • SimonEntholzer
  • krusche
  • pzdr7
  • Hialus
  • anian03

Possibly related PRs


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between b13f258 and 5a0bf48.

📒 Files selected for processing (1)
  • src/main/webapp/i18n/de/programmingExercise.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/webapp/i18n/de/programmingExercise.json (1)

Pattern src/main/webapp/i18n/de/**/*.json: 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".

🔇 Additional comments (3)
src/main/webapp/i18n/de/programmingExercise.json (3)

121-121: Gut gemacht! Die Beschreibung ist klar und präzise.

Die Beschreibung für den Online-Editor ist informativ und verwendet korrekt die informelle Ansprache. Sie vermittelt die wesentlichen Funktionen des Editors effektiv.


128-128: Ausgezeichnet! Die Beschreibung wurde verbessert.

Die Beschreibung für die Offline-IDE-Option ist klar und präzise. Sie verwendet korrekt die informelle Ansprache und erklärt die Funktionalität gut. Die vorgeschlagene Änderung aus dem vorherigen Review wurde erfolgreich umgesetzt.


135-137: Hervorragend! Die Beschreibung ist umfassend und präzise.

Die Beschreibung für die Online-IDE-Option ist sehr detailliert und informativ. Sie verwendet korrekt die informelle Ansprache und erklärt die Funktionalitäten der IDE ausführlich. Die Korrektur des Produktnamens "Visual Studio Code" wurde wie vorgeschlagen umgesetzt. Gut gemacht!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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

🧹 Outside diff range comments (1)
src/main/webapp/app/exercises/programming/manage/update/update-components/programming-exercise-difficulty.component.html (1)

Line range hint 45-108: Overall implementation looks great!

The changes consistently implement help icons for different IDE options (Offline IDE, Online Editor, and Online IDE) using the new Angular syntax. This aligns well with the PR objectives of adding tooltips to participation modes.

Key points:

  1. Consistent use of @if and @else directives, adhering to the new Angular syntax guidelines.
  2. Conditional rendering of help icons based on IDE selection validity.
  3. Proper integration with existing code structure.

These changes will significantly improve the user interface by providing clear descriptions for each participation mode option.

To further enhance maintainability, consider extracting the common logic for displaying help icons into a separate component or directive. This would reduce code duplication and make future updates easier.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between 330a677 and 3f34396.

📒 Files selected for processing (3)
  • src/main/webapp/app/exercises/programming/manage/update/update-components/programming-exercise-difficulty.component.html (3 hunks)
  • src/main/webapp/i18n/de/programmingExercise.json (1 hunks)
  • src/main/webapp/i18n/en/programmingExercise.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/main/webapp/app/exercises/programming/manage/update/update-components/programming-exercise-difficulty.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

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

Pattern src/main/webapp/i18n/de/**/*.json: 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".

🔇 Additional comments (8)
src/main/webapp/app/exercises/programming/manage/update/update-components/programming-exercise-difficulty.component.html (2)

45-47: LGTM! Adheres to coding guidelines.

The changes correctly implement the conditional rendering of the help icon for the "allowOfflineIde" option. The use of @else aligns with the new Angular syntax guidelines, replacing the older *ngIf directive. This addition enhances the user interface by providing contextual help when appropriate.


79-81: LGTM! Consistent implementation.

The changes for the "allowOnlineEditor" option mirror the implementation for "allowOfflineIde". The conditional rendering of the help icon is correctly implemented using the new Angular syntax (@else), adhering to the coding guidelines. This consistency in implementation enhances the overall user experience and maintainability of the code.

src/main/webapp/i18n/en/programmingExercise.json (4)

133-135: LGTM: New description for allowOnlineEditor added correctly.

The new description for the "allowOnlineEditor" option has been added correctly. It provides a clear and concise explanation of the online editor's features and limitations.


140-142: LGTM: New description for allowOfflineIde added correctly.

The new description for the "allowOfflineIde" option has been added correctly. It clearly explains the purpose of this option and its implications for students.


147-149: LGTM: New description for allowOnlineIde added correctly.

The new description for the "allowOnlineIde" option has been added correctly. It provides a comprehensive explanation of the online IDE's features and capabilities.


133-149: Changes align well with PR objectives and enhance user experience.

The new descriptions for "allowOnlineEditor", "allowOfflineIde", and "allowOnlineIde" have been successfully added to the English translations file. These additions directly address the PR objective of enhancing the user interface by providing clear tooltips for the participation modes in programming exercises.

The descriptions are concise, informative, and highlight the key features and limitations of each mode:

  1. Online Editor: Emphasizes the text editing capabilities without compilation or execution.
  2. Offline IDE: Clarifies the option for local development using preferred IDEs.
  3. Online IDE: Highlights the advanced features, including compilation and execution capabilities.

These changes will significantly improve the user experience by helping students make informed decisions about their preferred participation mode.

src/main/webapp/i18n/de/programmingExercise.json (2)

121-124: LGTM: Description for Online-Editor is clear and accurate.

The description for the online editor is well-written and informative. It correctly uses the informal "du" form as required by the coding guidelines.


135-138: LGTM: Description for Online-IDE is comprehensive and well-written.

The description for the online IDE option is detailed, informative, and correctly uses the informal "du" form. It provides a clear explanation of the features and capabilities of the online IDE.

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 13, 2024
farisd16
farisd16 previously approved these changes Oct 13, 2024
Copy link
Member

@farisd16 farisd16 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, I could see two participation modes and tooltips next to them

cremertim
cremertim previously approved these changes Oct 13, 2024
Copy link
Contributor

@cremertim cremertim left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

@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: 1

🧹 Outside diff range comments (2)
src/test/javascript/spec/component/programming-exercise/update-components/programming-exercise-difficulty.component.spec.ts (2)

Line range hint 63-75: Enhance test case assertions and mock setup.

While the existing test cases cover basic functionality, consider the following improvements:

  1. Use more specific assertions as per our coding guidelines. For example, replace:

    expect(comp.theiaEnabled).toBeTrue();

    with:

    expect(comp.theiaEnabled).toBe(true);
  2. Consider moving the ProfileService mock setup to a beforeEach block for better organization and to ensure a clean mock for each test.

  3. Add more specific expectations to verify the component's behavior, such as checking if certain elements are rendered based on the theiaEnabled flag.

Would you like assistance in implementing these improvements?


Line range hint 63-75: Improve test coverage with additional test cases.

The current test suite provides minimal coverage for the ProgrammingExerciseDifficultyComponent. Consider adding the following test cases to improve coverage and ensure robust functionality:

  1. Test the behavior of the component when different programmingExerciseCreationConfig values are provided.
  2. Verify the rendering and functionality of the DifficultyPickerComponent and TeamConfigFormGroupComponent within this component.
  3. Test any methods or computed properties that may exist in the ProgrammingExerciseDifficultyComponent.
  4. Add edge case tests, such as handling of null or undefined values for programmingExercise or programmingExerciseCreationConfig.

Would you like assistance in drafting these additional test cases?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between 3f34396 and 1bda254.

📒 Files selected for processing (3)
  • src/main/webapp/i18n/de/programmingExercise.json (1 hunks)
  • src/main/webapp/i18n/en/programmingExercise.json (1 hunks)
  • src/test/javascript/spec/component/programming-exercise/update-components/programming-exercise-difficulty.component.spec.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/main/webapp/i18n/de/programmingExercise.json (1)

Pattern src/main/webapp/i18n/de/**/*.json: 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".

src/test/javascript/spec/component/programming-exercise/update-components/programming-exercise-difficulty.component.spec.ts (1)

Pattern src/test/javascript/spec/**/*.ts: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}

🔇 Additional comments (8)
src/test/javascript/spec/component/programming-exercise/update-components/programming-exercise-difficulty.component.spec.ts (2)

17-17: LGTM: Import statement for ArtemisSharedComponentModule.

The import statement for ArtemisSharedComponentModule is correctly added and follows the proper syntax and naming conventions.


28-28: LGTM: TestBed configuration updated correctly.

The addition of ArtemisSharedComponentModule to the imports array is consistent with the new import statement and allows the test suite to use shared components. The order of imports is logical, with ArtemisTestModule followed by ArtemisSharedComponentModule.

It's also worth noting that the test configuration adheres to the coding guideline of avoiding NO_ERRORS_SCHEMA, which is a good practice for more robust tests.

src/main/webapp/i18n/en/programmingExercise.json (4)

133-135: LGTM: Clear and concise description for Online Editor.

The description accurately explains the features and limitations of the Online Editor option.


140-142: LGTM: Concise description for Offline IDE.

The description clearly explains what the Offline IDE option allows students to do.


147-149: LGTM: Accurate description for Online IDE, incorporating previous feedback.

The description clearly explains the features of the Online IDE option, including its basis on Visual Studio Code, code highlighting and formatting features, pre-configuration, and the ability to compile or run code online. This description has already incorporated the suggestion from the previous review comment.


133-149: LGTM: Clear and consistent descriptions for programming exercise participation modes.

The added descriptions for Online Editor, Offline IDE, and Online IDE provide clear and concise explanations of each option. These additions will help users understand the differences between the participation modes, improving the overall user experience. The descriptions are consistent in style and formatting with the rest of the file.

src/main/webapp/i18n/de/programmingExercise.json (2)

121-124: LGTM! Clear and concise description.

The description for the online editor is well-written, accurately describing its features while maintaining the informal tone as per the German language guidelines.


128-130: LGTM! Description improved as suggested.

The description for the offline IDE option has been updated as per the previous review suggestion. It maintains clarity while using the informal "du" form consistently, adhering to the German language guidelines.

src/main/webapp/i18n/de/programmingExercise.json Outdated Show resolved Hide resolved
HawKhiem
HawKhiem previously approved these changes Oct 13, 2024
Copy link

@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.

Works great

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 13, 2024
pzdr7
pzdr7 previously approved these changes Oct 13, 2024
Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Code 👍

asliayk
asliayk previously approved these changes Oct 13, 2024
Copy link
Contributor

@asliayk asliayk 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

@magaupp magaupp added the deploy:artemis-test9 Testserver for Project Theia label Oct 13, 2024
@magaupp magaupp temporarily deployed to artemis-test9.artemis.cit.tum.de October 13, 2024 20:54 — with GitHub Actions Inactive
@github-actions github-actions bot removed the deploy:artemis-test9 Testserver for Project Theia label Oct 13, 2024
pzdr7
pzdr7 previously approved these changes Oct 15, 2024
Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

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

Reapprove

magaupp
magaupp previously approved these changes Oct 18, 2024
Copy link
Contributor

@magaupp magaupp 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 TS9. Still works.

Looks like most changes made it into #9471.

@iyannsch iyannsch force-pushed the feature/programming-exercises/add-tooltip-to-participation-modes branch from e8f4480 to 5a0bf48 Compare October 18, 2024 17:18
@github-actions github-actions bot added the tests label Oct 18, 2024
@github-actions github-actions bot removed the tests label Oct 18, 2024
@iyannsch iyannsch changed the title Programming exercises: Add tooltips to participation modes Programming exercises: Adjust translations for participation mode tooltips Oct 18, 2024
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!) ready for review
Projects
Status: Developer Approved
Development

Successfully merging this pull request may close these issues.