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: Prevent problem statement from closing when viewing changes #8355

Merged
merged 7 commits into from
Apr 11, 2024

Conversation

pzdr7
Copy link
Contributor

@pzdr7 pzdr7 commented Apr 8, 2024

Checklist

General

Client

Motivation and Context

During the second testing session for 7.0.0, we noticed that clicking on the "Show Difference" / "Only show new Version" buttons closed the problem statement for some exercise types.

This was because the problem statement (which collapses when clicked) registered a click when the button was clicked.

Description

  • Stops the click from propagating to the problem statement, thus preventing it from collapsing
  • Verifies in the tests that this stopPropagation occurs

Steps for Testing

Prerequisites:

  • 1 Exam (this change should affect all exercise types except for programming, which doesn't have this issue)
  • 1 Student
  • 1 Instructor
  1. Open the exam as a student, viewing an exercise.
  2. In a different browser: As the instructor, edit the problem statement of that exercise.
  3. When the option becomes available, click on "Show Difference" / "Only show new Version"
  4. Verify that the problem statement does not collapse when you click on the button.
  5. Verify that the problem statement still collapses when you click elsewhere on the problem statement.

Testserver States

Note

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







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

@github-actions github-actions bot added tests client Pull requests that update TypeScript code. (Added Automatically!) labels Apr 8, 2024
@pzdr7 pzdr7 changed the title Exam mode: Prevent problem statement from closing when viewing the difference Exam mode: Prevent problem statement from closing when viewing changes Apr 8, 2024
@pzdr7 pzdr7 marked this pull request as ready for review April 8, 2024 21:53
@pzdr7 pzdr7 requested a review from a team as a code owner April 8, 2024 21:53
Copy link

coderabbitai bot commented Apr 8, 2024

Walkthrough

This update enhances the user interaction within an exam context by refining the problem statement update mechanism. Specifically, it modifies how events are handled when toggling the highlighted state of problem statements, ensuring a more intuitive and controlled user experience by preventing event propagation.

Changes

File Path Change Summary
.../exam-exercise-update-highlighter.component.html Updated (click) event to pass $event to toggleHighlightedProblemStatement().
.../exam-exercise-update-highlighter.component.ts Added MouseEvent parameter to toggleHighlightedProblemStatement and implemented event.stopPropagation().
.../spec/.../exam-exercise-update-highlighter.component.spec.ts Added test for stopPropagation when toggleHighlightedProblemStatement is called with a mouse event.

Possibly related issues


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 11d29c3 and 27b39d4.
Files selected for processing (1)
  • src/main/webapp/app/exam/participate/exercises/exam-exercise-update-highlighter/exam-exercise-update-highlighter.component.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/main/webapp/app/exam/participate/exercises/exam-exercise-update-highlighter/exam-exercise-update-highlighter.component.ts

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@krusche krusche added this to the 7.0.0 milestone Apr 10, 2024
Copy link
Member

@julian-christl julian-christl 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

Copy link
Contributor

@coolchock coolchock left a comment

Choose a reason for hiding this comment

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

tested during testing session, works as described. Code LGTM

Copy link
Contributor

@undernagruzez undernagruzez left a comment

Choose a reason for hiding this comment

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

tested during a testing session and works as expected, code also lgtm

Copy link
Contributor

@muradium muradium left a comment

Choose a reason for hiding this comment

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

Tested during testing session, works as expected

Copy link
Contributor

@rstief rstief left a comment

Choose a reason for hiding this comment

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

tested in testing session, works as expected.

@krusche krusche merged commit d720ae3 into develop Apr 11, 2024
42 of 48 checks passed
@krusche krusche deleted the bugfix/exam-diff-button-problem-statement branch April 11, 2024 15:24
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 to merge small tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

7 participants