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: Prepare exercise start when generating student exams #9119

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

Conversation

coolchock
Copy link
Contributor

@coolchock coolchock commented Jul 25, 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

Motivation and Context

Instructors sometimes forget to manually click the "Start Exercises" button before the exam begins. This can lead to a significant server overload when students start working on their exams, as all exercises need to be initiated simultaneously at that point. Automating the start of exercises helps prevent this potential performance issue and ensures a smoother experience for both students and instructors.

Description

The "Start Exercises" button has been removed, and the logic to start exercises has been moved to the point where student exams are generated. This ensures that exercises are started automatically during the exam generation process, eliminating the need for manual intervention and reducing the risk of server overload when students begin their exams.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Student
  • 1 exam with all exercise types
  1. Log in to Artemis
  2. Navigate to Exam Management
  3. Register a few users to the exam
  4. Go to Student Exams and click generate exams
  5. Verify that exercises were started
  6. As a student, try to participate in the exam and verify that you can without any problems

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

Summary by CodeRabbit

  • New Features

    • Simplified exam management by removing specific messaging related to starting exercises.
    • Enhanced test suite with new assessments for quiz exercise results.
  • Bug Fixes

    • Removed functionality for preparing exercises at the start of an exam, improving clarity in exam management.
  • Documentation

    • Updated localization files in German and English to reflect the removal of exercise initiation feedback.
  • Tests

    • Added new test cases for quiz exercises and updated existing tests for consistency with the new logic.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) labels Jul 25, 2024
Copy link

github-actions bot commented Aug 2, 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 Aug 2, 2024
@github-actions github-actions bot closed this Aug 16, 2024
@coolchock coolchock removed the stale label Aug 29, 2024
@coolchock coolchock reopened this Aug 29, 2024
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.

@github-actions github-actions bot added the stale label Sep 5, 2024
@coolchock coolchock removed the stale label Sep 5, 2024
@coolchock coolchock marked this pull request as ready for review September 6, 2024 08:09
@coolchock coolchock requested a review from a team as a code owner September 6, 2024 08:09
Copy link

coderabbitai bot commented Sep 6, 2024

Walkthrough

The changes involve modifications to the localization files for the Artemis application, specifically the removal of certain keys related to starting exercises and their associated messages in both German and English. Additionally, updates were made to the end-to-end testing suite, introducing a new test case for quiz exercise results and restructuring existing tests to accommodate this addition. The prepareExerciseStartForExam method was removed from the ExamAPIRequests class, indicating a shift in how exercises are prepared for exams.

Changes

Files Change Summary
src/main/webapp/i18n/de/exam.json Removed localization strings related to startExercises, startExerciseSuccess, and startExerciseFailure in German.
src/main/webapp/i18n/en/exam.json Removed localization strings related to startExercises, startExerciseSuccess, and startExerciseFailure in English.
src/test/playwright/e2e/exam/ExamResults.spec.ts Added new test case for ExerciseType.QUIZ and restructured existing tests for consistency with new quiz logic.
src/test/playwright/support/requests/ExamAPIRequests.ts Removed prepareExerciseStartForExam method, eliminating the functionality for preparing exercises at the start of an exam.

Possibly related PRs

Suggested labels

ready to merge

Suggested reviewers

  • SimonEntholzer
  • coolchock
  • JohannesStoehr
  • BBesrour
  • sarpsahinalp

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

Outside diff range comments (5)
src/main/webapp/app/exam/manage/student-exams/student-exams.component.html (1)

Line range hint 1-100: Review of HTML Template Changes and Angular Syntax Usage

The removal of the startExercisesButton significantly alters the user interaction flow within the application. It's important to ensure that this functionality has been appropriately relocated or restructured to maintain a seamless user experience. The use of the new Angular syntax (@if and @for) is correctly implemented throughout the file, aligning with the latest Angular best practices.

Ensure that the removal of the button does not degrade the user experience and that the new workflow for starting exercises is clearly communicated to the users.

src/main/webapp/app/exam/manage/student-exams/student-exams.component.ts (1)

Line range hint 1-300: Review of TypeScript Component Changes

The removal of the startExercises method from the StudentExamsComponent represents a significant change in functionality. It's crucial to verify that this functionality has been relocated or restructured elsewhere in the application to maintain the integrity of the exam management process. The remaining methods, such as handleGenerateStudentExams and generateMissingStudentExams, appear to be correctly implemented and are essential for the management of student exams.

Verify that the removal of the startExercises method does not negatively impact the user experience and that alternative mechanisms for starting exercises are robust and clearly documented.

src/test/java/de/tum/in/www1/artemis/service/exam/ExamQuizServiceTest.java (1)

Line range hint 1-400: Review of Java Test Class Changes

The modifications in the ExamQuizServiceTest class, including the removal of certain assertions and the introduction of Thread.sleep(1000), indicate a shift towards testing the state of student participations asynchronously. While this approach may better simulate real-world scenarios, it's important to ensure that the tests remain accurate and that the use of delays does not introduce flakiness or performance issues in the test suite.

Consider using more robust asynchronous testing techniques, such as those provided by Awaitility, to handle timing issues more reliably than Thread.sleep().

src/main/webapp/app/exam/manage/exam-management.service.ts (1)

Line range hint 1-1: Confirm removal of startExercises method.

The removal of the startExercises method simplifies the control flow but may impact functionalities that depend on this method. Ensure that all functionalities that previously depended on this method are either removed or refactored to work without it.

src/main/java/de/tum/in/www1/artemis/web/rest/StudentExamResource.java (1)

Line range hint 1-1: Confirm removal of startExercises method.

The removal of the startExercises method simplifies the StudentExamResource class but may impact functionalities that depend on this method. Ensure that all functionalities that previously depended on this method are either removed or refactored to work without it.

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.

Tested on TS1. I can generate exams and as a student participate in the exam without any problem

Screenshot 2024-10-25 192957
Screenshot 2024-10-25 192422
Screenshot 2024-10-25 192556

After submitting, the submission is also recorded correctly!
Screenshot 2024-10-25 193123

Copy link

@sachmii sachmii 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 TS1, worked just fine and I could generate the exams. Changes appeared correctly.

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.

re-approve after resolved merge conflicts

Copy link
Contributor

@edkaya edkaya left a comment

Choose a reason for hiding this comment

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

Reapprove after resolving merge conflicts

Copy link
Contributor

@EneaGore EneaGore left a comment

Choose a reason for hiding this comment

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

re-approve after merge conflicts

Copy link

@Cathy0123456789 Cathy0123456789 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 TS1. Everything works as expected.

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.

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!) documentation exam Pull requests that affect the corresponding module playwright programming Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!) tests
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

10 participants