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: Hide unreleased learning objects in learning path view #9105

Merged

Conversation

JohannesStoehr
Copy link
Contributor

@JohannesStoehr JohannesStoehr commented Jul 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 added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Motivation and Context

Learning paths should not show unreleased learning objects to the student, which is currently the case.

Description

Learning paths no longer send data like the title to the client. Instead the unreleased learning objects are marked with a placeholder in the learning path view, so students are aware that they will get more learning opportunities later on.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Student
  • 1 Course with learning paths enabled and one Competency
  1. Log in to Artemis
  2. Navigate to Course Administration
  3. Create an exercise/lecture unit and set the release date in the future
  4. Check that it is not shown in the learning path view to the student

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-nav-overview-learning-objects.component.ts 85.71%

Server

Class/File Line Coverage Confirmation (assert/expect)
LearningPathService.java 97%

Screenshots

image

Summary by CodeRabbit

  • New Features

    • Introduced visibility status for learning objects, allowing users to see which materials are accessible or unreleased.
    • Added visual indicators for unreleased learning objects in the user interface, enhancing usability.
  • Bug Fixes

    • Enhanced filtering logic to ensure only visible learning materials are presented to students.
  • Documentation

    • Updated localization files to include labels for unreleased learning objects in both German and English.
  • Tests

    • Added new tests to ensure unreleased learning objects do not appear in learning path navigation.

@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) labels Jul 22, 2024
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Jul 22, 2024
@JohannesStoehr JohannesStoehr marked this pull request as ready for review July 23, 2024 07:44
@JohannesStoehr JohannesStoehr requested a review from a team as a code owner July 23, 2024 07:44
Copy link

coderabbitai bot commented Jul 23, 2024

Walkthrough

The recent changes enhance the visibility and accessibility of learning objects in the Artemis platform. Key updates include the introduction of a method to check visibility, refined filtering in learning path logic, and UI enhancements to signify unreleased content. These modifications create a more intuitive user experience, ensuring students interact only with accessible materials while improving overall control flow in related services.

Changes

Files Change Summary
src/main/java/de/tum/in/www1/artemis/domain/LearningObject.java Added boolean isVisibleToStudents() method to retrieve visibility status for students.
src/main/java/de/tum/in/www1/artemis/domain/lecture/LectureUnit.java Updated isVisibleToStudents() method to include checks for the associated lecture's visibility, enhancing control flow and robustness.
src/main/java/de/tum/in/www1/artemis/service/learningpath/LearningPathService.java Renamed and enhanced findWithCompetenciesAndLearningObjectsAndCompletedUsersById method to exclude exercises and lecture units not visible to students.
src/main/java/de/tum/in/www1/artemis/web/rest/dto/competency/LearningPathNavigationObjectDTO.java Modified LearningPathNavigationObjectDTO to include a new unreleased boolean field indicating visibility status.
src/main/webapp/app/course/learning-paths/components/learning-path-nav-overview-learning-objects/... Added UI logic to visually distinguish unreleased learning objects using a muted label and lock icon.
src/main/webapp/i18n/de/learningPath.json Added localization for unreleased learning objects with a new label.
src/main/webapp/i18n/en/learningPath.json Introduced a new localization key for unreleased learning objects to enhance user experience.
src/test/java/de/tum/in/www1/artemis/competency/LearningPathIntegrationTest.java Added a new test to ensure unreleased learning objects do not appear in navigation paths, alongside repository integration.
src/test/java/de/tum/in/www1/artemis/service/LearningPathServiceTest.java Introduced a method to verify that unreleased learning objects are excluded from generated learning path representations.

Sequence Diagram(s)

sequenceDiagram
    participant Student
    participant LearningPathService
    participant LearningObjectService
    participant UI

    Student->>LearningPathService: Request learning path
    LearningPathService->>LearningObjectService: Check visibility of learning objects
    LearningObjectService-->>LearningPathService: Return visibility status
    LearningPathService-->>UI: Send visible learning objects
    UI->>Student: Display learning path with accessible objects
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: 1

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 23, 2024
coolchock
coolchock previously approved these changes Jul 23, 2024
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 on ts4, works as expected. code also LGTM

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

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

@MaximilianAnzinger MaximilianAnzinger added the maintainer-approved The feature maintainer has approved the PR label Jul 29, 2024
@krusche krusche removed ready to merge maintainer-approved The feature maintainer has approved the PR labels Aug 4, 2024
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

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 after merge conflict

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.

Reapprove

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.

reapprove after merge conflicts

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.

re-approve after merge conflicts

Copy link
Contributor

@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 9, 2024
@krusche krusche merged commit 8c19389 into develop Aug 11, 2024
26 of 30 checks passed
@krusche krusche deleted the bugfix/learning-paths/hide-unreleased-learning-objects branch August 11, 2024 06:07
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 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