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: Notify instructors about changes in the test repository for exam exercise #9242

Conversation

coolchock
Copy link
Contributor

@coolchock coolchock commented Aug 22, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) 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 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.
  • I strictly followed the client coding and design guidelines.
  • I documented the TypeScript code using JSDoc style.
  • I translated all newly inserted strings into English and German.

Motivation and Context

Instructors need to be notified about changes in the test repository for programming exercises in exams. This is crucial because such changes can affect student results. However, the rebuilding of submissions does not happen automatically, as it is a very expensive operation, especially for exams with around 2000 students. Rebuilding must be triggered manually, and instructors should do this only after they have completed their changes in the test repository.

Description

A new notification type has been added. This notification is enabled by default. Instructors will receive a notification in the navigation bar as well as a message pop-up to ensure they do not miss it. The notification is triggered when changes to the test repository affect the results (e.g., changing the test logic), but not for non-impactful changes (e.g., modifying a comment). The notification is only sent if there are already existing results for the exam programming exercise.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Student
  • 1 Exam with Programming Exercise
  1. Clone the test repository as an instructor.
  2. As a student, participate in the exam and make a submission for a programming exercise (use an incognito tab or another browser). Ensure that at least one of the tests passes.
  3. Modify the test case that previously passed so that it always fails, then push your changes to the repository.
  4. Verify that you receive a notification and a pop-up about changes in the test repository for an exam exercise.
  5. Make some changes to the test repository that do not affect the results (e.g., adding a comment).
  6. Verify that you do not receive a notification.

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
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Summary by CodeRabbit

  • New Features

    • Introduced a new notification type for changes in programming exam test cases, improving communication regarding updates.
    • Added notifications for instructors and editors specifically related to programming exam updates.
  • Localization

    • Enhanced notification messages in English and German for better clarity and user understanding regarding programming exam test case changes.
  • Bug Fixes

    • Improved notification handling logic to ensure accurate notifications are sent based on the type of programming exercise.
  • Tests

    • Added test cases to ensure proper functionality of the new notification features.

@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) labels Aug 22, 2024
@github-actions github-actions bot added the tests label Aug 22, 2024
@coolchock coolchock changed the title Feature/exam mode/notify instructors about test repository changes Exam mode: Notify instructors about changes in the test repository Aug 25, 2024
@coolchock coolchock temporarily deployed to artemis-test2.artemis.cit.tum.de August 27, 2024 06:24 — with GitHub Actions Inactive
@coolchock coolchock changed the title Exam mode: Notify instructors about changes in the test repository Exam mode: Notify instructors about changes in the test repository for exam exercise Aug 27, 2024
@coolchock coolchock marked this pull request as ready for review August 27, 2024 06:56
@coolchock coolchock requested a review from a team as a code owner August 27, 2024 06:56
Copy link

coderabbitai bot commented Aug 27, 2024

Walkthrough

The changes introduce a new notification type, PROGRAMMING_EXAM_TEST_CASES_CHANGED, across various components of the system. This involves updates to enumeration constants, notification logic, and localization files to support notifications related to changes in test cases for programming exams. Additionally, new methods and constants are added to facilitate the handling and display of these notifications.

Changes

Files Change Summary
src/main/java/de/tum/in/www1/artemis/domain/enumeration/NotificationType.java Added PROGRAMMING_EXAM_TEST_CASES_CHANGED to the NotificationType enum.
src/main/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactory.java Updated createNotification method and added createPlaceholderExamExerciseNotification to handle the new notification type.
src/main/java/de/tum/in/www1/artemis/domain/notification/NotificationConstants.java Introduced PROGRAMMING_EXAM_TEST_CASES_CHANGED_TITLE and PROGRAMMING_EXAM_TEST_CASES_CHANGED_TEXT constants for notifications.
src/main/java/de/tum/in/www1/artemis/service/notifications/GroupNotificationService.java Renamed method to notify about changed test cases specifically for exam programming exercises.
src/main/java/de/tum/in/www1/artemis/service/notifications/NotificationSettingsService.java Updated notification constant for programming exam test cases.
src/main/java/de/tum/in/www1/artemis/service/programming/ProgrammingMessagingService.java Modified notifyUserAboutTestCaseChanged method to include conditional logic for exam exercises.
src/main/webapp/app/entities/notification.model.ts Added PROGRAMMING_EXAM_TEST_CASES_CHANGED_TITLE constant.
src/main/webapp/app/shared/constants/user-settings.constants.ts Introduced NOTIFICATION__EDITOR_NOTIFICATION__PROGRAMMING_EXAM_TEST_CASES_CHANGED entry in SettingId enum.
src/main/webapp/app/shared/notification/notification-popup/notification-popup.component.ts Updated to include PROGRAMMING_EXAM_TEST_CASES_CHANGED_TITLE in notification titles.
src/main/webapp/app/shared/user-settings/notification-settings/notification-settings-structure.ts Added entry for programmingExamTestCasesChanged in notificationSettingsStructure.
src/main/webapp/i18n/de/notification.json Added localization entries for programmingExamTestCasesChanged.
src/main/webapp/i18n/de/userSettings.json Added entries for programmingExamTestCasesChanged and programmingExamTestCasesChangedDescription.
src/main/webapp/i18n/en/notification.json Introduced English localization for programmingExamTestCasesChanged.
src/main/webapp/i18n/en/userSettings.json Added English localization for programmingExamTestCasesChanged and its description.
src/test/java/de/tum/in/www1/artemis/domain/notification/GroupNotificationFactoryTest.java Added test method for the new notification type handling.
src/test/java/de/tum/in/www1/artemis/notification/GroupNotificationServiceTest.java Added test method to verify notifications for changed test cases in exam programming exercises.

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

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

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

Code looks good 👍 One test is failing: https://bamboo.ase.in.tum.de/browse/ARTEMIS-TESTS7024-JAVATEST-4/test/case/769040033

Reading its java docs in the code looks a bit concerning, as the changes here might affect other clients (like the iOS app) too.
Is this an issue for this PR?

Its java docs
    /**
     * If this test fails, you have changed the notification placeholder files. This may have dramatic consequences on the mobile applications (iOS & Android) and the database.
     * Changing the notification placeholders files changes the following things:
     * 1. Other key value pairs are sent to the clients. This may mean that the native clients no longer understand them and notifications are no longer shown to users.
     * 2. The database becomes inconsistent. The placeholders are stored as JSON in the database.
     * You must now do the following:
     * 1. Check if you really need to change these placeholders. If not, revert your changes.
     * 2. Write a database migration for the old placeholder JSON strings, such that they match your new signature.
     * 3. Increment the {{@link de.tum.in.www1.artemis.config.Constants#PUSH_NOTIFICATION_VERSION}}. This ensures that old versions of the native apps discard your new
     * notifications.
     * 4. Update both the Android and iOS app. Only merge this server PR after they have been updated and released to the stores. Otherwise, notifications no longer work for
     * end users.
     * 5. Execute the Gradle task generatePlaceholderRevisionSignatures to make this test pass again.
     */

public static String[] createPlaceholderExerciseNotification(String courseTitle, String exerciseTitle) {
return new String[] { courseTitle, exerciseTitle };
}

@NotificationPlaceholderCreator(values = { EXERCISE_RELEASED, EXERCISE_PRACTICE, QUIZ_EXERCISE_STARTED, EXERCISE_UPDATED, PROGRAMMING_TEST_CASES_CHANGED,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this list and the one above the same? And will they also stay the same?
If so, please move them into a common array and use it for these two occurrences

Copy link

github-actions bot commented Sep 5, 2024

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

Copy link

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 13, 2024
@github-actions github-actions bot closed this Sep 27, 2024
@coolchock coolchock reopened this Sep 27, 2024
@github-actions github-actions bot removed the stale label Sep 28, 2024
Copy link

github-actions bot commented Oct 5, 2024

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

Copy link

github-actions bot commented Nov 8, 2024

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 8, 2024
@github-actions github-actions bot closed this Nov 23, 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!) server Pull requests that update Java code. (Added Automatically!) stale tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants