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 analytics: Add empty student course dashboard behind feature flag #8513

Closed
wants to merge 26 commits into from

Conversation

kaancayli
Copy link
Contributor

@kaancayli kaancayli commented Apr 30, 2024

⚠️ Warning: Test only on TS4

⚠️ Warning: Includes database migration! ⚠️

Warning

Needs the future toggle to be activated by an admin on the server deployed in order to be tested.

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.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • 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

In the future we want students to gain better insights about their performance in a course. Therefore, we proposed to add a new dashboard-view to the course overview page that will include learning analytics and an Iris chatbot. This PR lays the groundwork of the newly proposed feature

Description

  • A - for now - empty dashboard view.
  • Added a FutureToggle for the newly proposed dashboard view.
  • Added a toggle switch that allows (only admins) to enable/disable the new dashboard view on the course overview page.
  • Added a database migration to add a dashboard_enabled column to the Course entity

Steps for Testing

Prerequisites:

  • 1 Admin
  • 1 Student
  • 1 Instructor
  • 1 Course
  1. As an admin log in to Artemis
  2. Toggle the dashboard in the Feature Toggles on the server settings.
  3. Go into a course with "Student View" and open the course overview page.
  4. Verify that dashboard tab on the course overview page is not yet visible.
  5. Edit the course and enable the dashboard for the course.
  6. Again go into course overview page and verify that dashboard tab is now visible.
  7. Navigate to dashboard view by clicking the tab
  8. You should now see a page with a Work in Progress placeholder text.
  9. Again go into Feature Toggle section in the server administration and deselect the Dashboard option.
  10. Verify now on the course overview page that Dashboard tab is not visible.
  11. As a student go into a course with dashboard feature enabled.
  12. Verify that student can see the dashboard tab and navigate to the page.
  13. As an instructor edit a course and verify that you can not see Enable Dashboard checkbox.
  14. Verify that everything regarding the new feature is correctly translated by switching the language.

Testserver States

Note

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






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

Screenshots

Changes:

Sidebar:
Capture-2024-04-30-171822
Enable Dashboard toggle in settings:
Capture-2024-04-30-170338
Feature toggle:
Feature Toggles · 5 03pm · 04-30
Dashboard page (WIP)
Dashboard _ Introduction to Programming · 5 18pm · 04-30

@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 Apr 30, 2024
@kaancayli kaancayli changed the title Feature/learning analytics/student dashboard Learning Analytics: Add new dashboard view Apr 30, 2024
@FelixTJDietrich FelixTJDietrich self-requested a review April 30, 2024 14:32
@FelixTJDietrich FelixTJDietrich changed the title Learning Analytics: Add new dashboard view Learning analytics: Add new dashboard view Apr 30, 2024
@kaancayli kaancayli force-pushed the feature/learning-analytics/student-dashboard branch from acff5e8 to a662753 Compare April 30, 2024 14:41
@kaancayli kaancayli changed the title Learning analytics: Add new dashboard view Add empty student course dashboard behind feature flag Apr 30, 2024
@kaancayli kaancayli changed the title Add empty student course dashboard behind feature flag Learning analytics: Add empty student course dashboard behind feature flag Apr 30, 2024
@kaancayli kaancayli marked this pull request as ready for review April 30, 2024 15:27
@kaancayli kaancayli requested a review from a team as a code owner April 30, 2024 15:27
Copy link

coderabbitai bot commented Apr 30, 2024

Walkthrough

The updates across various files in the Artemis project introduce new dashboard features for courses, including analytics and display options. New boolean fields and corresponding methods have been added to manage these features, alongside updates to the UI components and services to support toggling and displaying these new functionalities. Additionally, security measures prevent unauthorized changes, and new routes enhance navigation.

Changes

File Path Changes
.../domain/Course.java
.../entities/course.model.ts
Added dashboardEnabled and studentCourseAnalyticsDashboardEnabled fields with getters and setters.
.../service/feature/Feature.java
.../service/feature/FeatureToggleService.java
.../shared/feature-toggle/feature-toggle.service.ts
Introduced new features Dashboard and StudentCourseAnalyticsDashboard in enums and toggles.
.../web/rest/CourseResource.java Added checks to prevent unauthorized dashboard setting changes.
.../manage/course-update.component.*
.../test/javascript/spec/component/course/course-update.component.spec.ts
Updated course management components to handle new dashboard settings.
.../overview/course-dashboard/...
.../overview/course-overview.component.ts
.../overview/courses-routing.module.ts
Enhanced course dashboard components and routing for new dashboard features.
.../overview/visualizations/... Updated visualization components to adapt to new dashboard settings.
.../layouts/navbar/navbar.component.ts Added new dashboard menu item in the navigation bar.
.../learninganalytics/StudentLearningAnalyticsIntegrationTest.java
.../service/FeatureToggleServiceTest.java
Updated integration and service tests to include new dashboard features.
src/main/webapp/i18n/de/global.json Localization support for dashboard terminology in German.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 1d9a407 and 822ba5d.
Files selected for processing (3)
  • src/main/java/de/tum/in/www1/artemis/service/feature/FeatureToggleService.java (2 hunks)
  • src/main/java/de/tum/in/www1/artemis/web/rest/CourseResource.java (1 hunks)
  • src/main/webapp/app/shared/layouts/navbar/navbar.component.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/main/webapp/app/shared/layouts/navbar/navbar.component.ts
Files skipped from review as they are similar to previous changes (1)
  • src/main/java/de/tum/in/www1/artemis/web/rest/CourseResource.java
Additional Context Used
Path-based Instructions (1)
src/main/java/de/tum/in/www1/artemis/service/feature/FeatureToggleService.java (1)

Pattern src/main/java/**/*.java: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,delegate_logic,http_only,minimal_dtos}; dtos:{java_records,no_entities,min_data,single_resp}; di:constructor_injection; kiss:simple_code; file_handling:os_indep_paths; practices:{least_access,avoid_transactions,code_reuse,static_member_ref,prefer_primitives}; sql:{param_annotation,uppercase,avoid_subqueries};java:avoid_star_imports

Additional comments not posted (2)
src/main/java/de/tum/in/www1/artemis/service/feature/FeatureToggleService.java (2)

Line range hint 51-64: Proper initialization of StudentCourseAnalyticsDashboard feature toggle.


Line range hint 1-64: The rest of the FeatureToggleService class is well-implemented and adheres to best practices.


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.

Copy link
Contributor

@FelixTJDietrich FelixTJDietrich left a comment

Choose a reason for hiding this comment

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

Here are some issues that I found. You probably also need server tests so we make sure that only admins change this setting (?)

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

Out of diff range and nitpick comments (1)
src/main/webapp/app/overview/visualizations/exercise-scores-chart/exercise-scores-chart.component.ts (1)

95-95: Clarify or remove the commented-out code related to legendPosition.

This commented-out line seems to be left unintentionally or for future use. If it's not needed, consider removing it to clean up the codebase. If it's for future use, please add a TODO comment explaining its purpose.

FelixTJDietrich
FelixTJDietrich previously approved these changes May 3, 2024
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.

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 May 10, 2024
Copy link
Contributor

@FelixTJDietrich FelixTJDietrich left a comment

Choose a reason for hiding this comment

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

Code changes look good to me and dashboard works as expected on TS4. Tested with my course and Kaan's course.

@FelixTJDietrich
Copy link
Contributor

Merged as part of #8582 into hd3-develop

@krusche krusche deleted the feature/learning-analytics/student-dashboard branch September 29, 2024 07:51
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
Development

Successfully merging this pull request may close these issues.

3 participants