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

Exam mode: Remove exercise title from solution containers #9442

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

edkaya
Copy link
Contributor

@edkaya edkaya commented Oct 8, 2024

Checklist

General

Client

  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

The title of an exercise is displayed three times during the exam (see screenshot), if the sidebar is not collapsed. Therefore, the exercise title in the solution container becomes unnecessary.

Description

Changed the exercise title displayed in the solution container to a static text "Your Solution", which is presented only in text, modeling, and file upload exercises.

Exam Mode Testing

Prerequisites:

  • 1 Exam with 3 exercises (text, modeling, and file upload)
  • 1 Student

(There is already an exam called 'Exam Title Container' under my course on TS4. Test users 1-5 are registered to the exam.)

  1. Log in to Artemis
  2. Participate in the exam
  3. Verify that you see 'Your Solution' or 'Deine Lösung' in the solution container header instead of the exercise title

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

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Screenshots

Before
Group 155

After
Screenshot 2024-10-08 at 21 32 31

Summary by CodeRabbit

  • New Features

    • Updated exercise title display logic to show a translated string for "your solution" based on the exam timeline state.
    • Added new translation keys for "your solution" in both English and German.
  • Bug Fixes

    • Improved clarity in user submissions by ensuring the correct title is displayed when the exam timeline is not available.

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Oct 8, 2024
@edkaya edkaya temporarily deployed to artemis-test4.artemis.cit.tum.de October 8, 2024 19:25 — with GitHub Actions Inactive
@edkaya edkaya marked this pull request as ready for review October 8, 2024 19:40
@edkaya edkaya requested a review from a team as a code owner October 8, 2024 19:40
@edkaya edkaya added the small label Oct 8, 2024
Copy link

coderabbitai bot commented Oct 8, 2024

Walkthrough

The pull request introduces changes to the HTML templates of three components related to exam submissions: file-upload-exam-submission.component.html, modeling-exam-submission.component.html, and text-exam-submission.component.html. The modifications focus on the conditional rendering of exercise titles based on the examTimeline state, replacing direct title displays with a translation key for "your solution." Additionally, new entries for the translation keys are added to the English and German JSON files, enhancing the user interface for exam submissions.

Changes

File Path Change Summary
src/main/webapp/app/exam/participate/exercises/file-upload/file-upload-exam-submission.component.html Updated exercise title rendering to use translation key when examTimeline is true.
src/main/webapp/app/exam/participate/exercises/modeling/modeling-exam-submission.component.html Changed exercise title display logic to show translation key when examTimeline is falsy.
src/main/webapp/app/exam/participate/exercises/text/text-exam-submission.component.html Modified exercise title rendering to use translation key instead of group title when examTimeline is false.
src/main/webapp/i18n/de/exam.json Added "yourSolution": "Deine Lösung" to the exam section.
src/main/webapp/i18n/en/exam.json Added "yourSolution": "Your Solution" to the exam section.
src/test/javascript/spec/component/exam/participate/exercises/file-upload-exam-submission.component.spec.ts Updated tests to verify static text instead of dynamic values for exercise titles.
src/test/javascript/spec/component/exam/participate/exercises/modeling-exam-submission.component.spec.ts Removed unused import and updated tests to check for static text.

Possibly related PRs

Suggested labels

bugfix, user interface

Suggested reviewers

  • pzdr7
  • JohannesStoehr
  • coolchock
  • SimonEntholzer
  • anian03

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE

📥 Commits

Files that changed from the base of the PR and between b6b47e7 and 182626b.

📒 Files selected for processing (5)
  • src/main/webapp/app/exam/participate/exercises/file-upload/file-upload-exam-submission.component.html (1 hunks)
  • src/main/webapp/app/exam/participate/exercises/modeling/modeling-exam-submission.component.html (1 hunks)
  • src/main/webapp/app/exam/participate/exercises/text/text-exam-submission.component.html (1 hunks)
  • src/main/webapp/i18n/de/exam.json (1 hunks)
  • src/main/webapp/i18n/en/exam.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
src/main/webapp/app/exam/participate/exercises/file-upload/file-upload-exam-submission.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/app/exam/participate/exercises/modeling/modeling-exam-submission.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/app/exam/participate/exercises/text/text-exam-submission.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/exam.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/app/exam/participate/exercises/modeling/modeling-exam-submission.component.html (1)

19-19: LGTM! Verify translation key existence.

The changes align with the PR objectives by conditionally rendering either the exercise title or "Your Solution" based on the examTimeline value. The new Angular syntax (@if) is correctly used as per the coding guidelines.

To ensure the translation key is properly set up, please run the following script:

src/main/webapp/app/exam/participate/exercises/text/text-exam-submission.component.html (1)

19-19: LGTM! Verify translation key existence.

The change aligns well with the PR objectives by replacing the exercise title with a translated "Your Solution" text when examTimeline is false. This modification enhances the user interface for exam submissions as intended.

To ensure the translation key is properly defined, please run the following script:

This script will help confirm that the new translation key is properly defined in both language files, ensuring a smooth localization experience.

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

153-153: Translation looks good!

The added translation "Deine Lösung" for "yourSolution" is correct and follows the required informal style (dutzen). It's consistent with the context and maintains the JSON structure.

coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 8, 2024
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, works as expected

Copy link
Contributor

@SimonEntholzer SimonEntholzer left a comment

Choose a reason for hiding this comment

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

Would it be possible here to use the jhiTranslate instead of the artemisTranslate pipe?

Copy link
Contributor

@JohannesStoehr JohannesStoehr left a comment

Choose a reason for hiding this comment

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

Code

@edkaya
Copy link
Contributor Author

edkaya commented Oct 9, 2024

Would it be possible here to use the jhiTranslate instead of the artemisTranslate pipe?

I couldn't find a way to use jhiTranslate here. Any suggestions?

Edit:
We can use something like this @SimonEntholzer:
<ng-container *ngTemplateOutlet="examTimeline ? yourSolution : exerciseTitle"></ng-container>
<ng-template jhiTranslate="artemisApp.exam.yourSolution"#yourSolution></ng-template>
<ng-template jhiTranslate="artemisApp.exam.exerciseTitle" #exerciseTitle></ng-template>

But I think it's not really a great approach if the only reason is to avoid using the artemisTranslate pipe here. So I would still use artemisTranslate here 😄

@MaximilianAnzinger MaximilianAnzinger changed the title Exam Mode: Remove Exercise Title From Solution Containers Exam mode: Remove Exercise Title From Solution Containers Oct 9, 2024
@MaximilianAnzinger MaximilianAnzinger changed the title Exam mode: Remove Exercise Title From Solution Containers Exam mode: Remove exercise title from solution containers Oct 9, 2024
@edkaya edkaya requested a review from SimonEntholzer October 9, 2024 19:05
Copy link
Contributor

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

@edkaya edkaya added ready to merge maintainer-approved The feature maintainer has approved the PR and removed ready for review labels Oct 10, 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!) maintainer-approved The feature maintainer has approved the PR ready to merge small tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants