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

Learning paths: Add setting to include all exercises relevant to the course score #9083

Conversation

JohannesStoehr
Copy link
Contributor

@JohannesStoehr JohannesStoehr commented Jul 18, 2024

🚨🚨 Contains Database Migration 🚨🚨

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 added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • 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 added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • 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.

Motivation and Context

#8758

Description

Instructors can now specify in the learning path management that all non-bonus and non-optional exercises (i.e. those that are relevant for the course score) have to be included in the learning paths. If this is enabled, these exercises are preferred when selecting the exercises for each difficulty. Additionally these exercises are also selected even if the mastery can be achieved with less exercises.

To save this setting a new configuration is stored in the course that saves all settings related to learning paths, since more settings might come in the future.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Student
  1. Log in to Artemis
  2. Create a few exercises with different difficulties and some are included in the course score and other are optional.
  3. Link the exercises to a competency and set the mastery threshold of the competency lower (e.g. 50%)
  4. Look at the learning path as a student and see that not all exercises are included
  5. Enable as instructor in the learning path management view that all exercises that are relevant to the course score have to be included
  6. Look at the learning path as a student and see that all exercises relevant to the course score are included

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

Test Coverage

Client

Class/File Line Coverage Confirmation (assert/expect)
learning-path-management.component.ts 94.25%
learning-path.service.ts 76.92%

Server

Class/File Line Coverage Confirmation (assert/expect)
LearningPathsConfiguration.java 100%
LearningPathNavigationService.java 92%
LearningPathRecommendationService.java 97%
LearningPathService.java 97%
LearningPathResource.java 97%

Screenshots

Temporary setting until @JohannesWt refactors them in a future PR:
Bildschirmfoto 2024-07-18 um 16 09 38

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced Learning Paths Configuration for courses, allowing enhanced customization of learning paths.
    • Added user interface options to include all graded exercises in learning paths.
    • Enhanced course creation and update processes to support learning paths configuration.
    • New API endpoints for retrieving and updating learning paths configurations.
  • Bug Fixes

    • Improved query methods for fetching courses with specific learning paths configurations.
  • Refactor

    • Updated various services and repositories to integrate Learning Paths Configuration.
    • Enhanced learning path recommendation and navigation logic to utilize the new configuration settings.
  • Tests

    • Expanded integration tests to validate new functionalities related to Learning Paths Configuration.

@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!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. labels Jul 18, 2024
@JohannesStoehr JohannesStoehr marked this pull request as ready for review July 18, 2024 14:23
@JohannesStoehr JohannesStoehr requested a review from a team as a code owner July 18, 2024 14:23
Copy link

coderabbitai bot commented Jul 18, 2024

Walkthrough

The recent updates introduce the LearningPathsConfiguration entity, enhancing learning path management within the system. This includes support for customizable configurations, particularly regarding the inclusion of graded exercises. Modifications span various components, including entities, repositories, services, and user interfaces, improving flexibility and user experience when managing learning paths.

Changes

File(s) Change Summary
src/main/java/de/tum/in/www1/artemis/domain/Course.java Added LearningPathsConfiguration field and accessor methods.
src/main/java/de/tum/in/www1/artemis/domain/competency/LearningPathsConfiguration.java Introduced LearningPathsConfiguration class for managing learning path settings.
src/main/java/de/tum/in/www1/artemis/repository/.../CourseRepository.java Added methods to retrieve courses with eager loading of learning paths configurations.
src/main/java/de/tum/in/www1/artemis/repository/.../LearningPathsConfigurationRepository.java Created repository interface for querying LearningPathsConfiguration.
src/main/java/de/tum/in/www1/artemis/service/.../LearningPathNavigationService.java Enhanced methods to incorporate LearningPathsConfiguration handling and updated constructor.
src/main/java/de/tum/in/www1/artemis/service/.../LearningPathRecommendationService.java Modified recommendation logic to consider values from LearningPathsConfiguration.
src/main/java/de/tum/in/www1/artemis/service/.../LearningPathService.java Integrated learning path configuration management, including a method to enable learning paths for courses.
src/main/java/de/tum/in/www1/artemis/web/rest/CourseResource.java Updated constructor and updateCourse method to handle LearningPathsConfiguration.
src/main/java/de/tum/in/www1/artemis/web/rest/LearningPathResource.java Added endpoints for retrieving and updating learning paths configurations.
src/main/webapp/app/course/learning-paths/.../learning-path-management.component.html Introduced UI elements for managing the inclusion of graded exercises in learning paths.
src/main/webapp/app/course/learning-paths/.../learning-path-management.component.ts Updated component to handle configuration loading and updating for learning paths.
src/main/webapp/app/entities/competency/learning-paths-configuration.model.ts Defined LearningPathsConfiguration and LearningPathsConfigurationDTO classes for structured data management.
src/main/webapp/i18n/en/competency.json Added localization entries for learning path configuration options.
src/test/java/de/tum/in/www1/artemis/competency/LearningPathIntegrationTest.java Enhanced integration tests for learning paths, validating configuration behaviors and CRUD operations.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CourseResource
    participant LearningPathsConfigurationRepository
    participant CourseRepository

    User->>CourseResource: Update Course with LearningPathsConfiguration
    CourseResource->>CourseRepository: Find existing Course
    CourseResource->>LearningPathsConfigurationRepository: Save LearningPathsConfiguration
    CourseResource->>CourseRepository: Save updated Course
    CourseRepository->>User: Return updated Course
Loading
sequenceDiagram
    participant User
    participant LearningPathResource
    participant LearningPathsConfigurationRepository

    User->>LearningPathResource: Get LearningPathsConfiguration
    LearningPathResource->>LearningPathsConfigurationRepository: Fetch by Course ID
    LearningPathsConfigurationRepository->>LearningPathResource: Return LearningPathsConfiguration
    LearningPathResource->>User: Return LearningPathsConfiguration
Loading

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.

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

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

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 18, 2024
coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 18, 2024
BBesrour
BBesrour previously approved these changes Jul 20, 2024
Copy link
Member

@BBesrour BBesrour 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 TS5, works as described.
Learning path only displays exercises that are relevant to course score.

Copy link
Member

@BBesrour BBesrour left a comment

Choose a reason for hiding this comment

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

Should learning paths display exercises that weren't released yet?
image

And there is a failing server test

@JohannesStoehr
Copy link
Contributor Author

Should learning paths display exercises that weren't released yet?

This is fixed in #9105, feel free to review as well

And there is a failing server test

Oh, fixed it!

Copy link
Contributor

@JohannesWt JohannesWt left a comment

Choose a reason for hiding this comment

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

Reapprove

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 👍

Copy link
Contributor

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

Copy link
Member

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

@krusche krusche modified the milestones: 7.4.5, 7.5.0 Jul 28, 2024
Copy link
Collaborator

@MaximilianAnzinger MaximilianAnzinger left a comment

Choose a reason for hiding this comment

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

maintainer approved

@JohannesStoehr JohannesStoehr added ready to merge maintainer-approved The feature maintainer has approved the PR labels Aug 1, 2024
@krusche krusche removed ready to merge maintainer-approved The feature maintainer has approved the PR labels Aug 4, 2024
@krusche krusche closed this Aug 4, 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!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. server Pull requests that update Java code. (Added Automatically!) tests
Projects
Archived in project
Status: Done
Development

Successfully merging this pull request may close these issues.

9 participants