Skip to content

Conversation

@MaximilianAnzinger
Copy link
Collaborator

@MaximilianAnzinger MaximilianAnzinger commented Apr 24, 2025

Checklist

General

Server

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 (e.g. using paging).
  • I strictly followed the principle of data economy for all client-server REST calls.
  • I strictly followed the client coding and design guidelines.

Motivation and Context

For an upcoming evaluation we want to analyze behavioral data of students. Our goal is to investigate how effective our instantiation of competency-based education is.

Description

Added new event log entries for Interactions with:

  • Competencies (overview and individual)
  • Learning Paths (general ui, naviagtion, and competency graph)

Steps for Testing

Prerequisites:

  • 1 Students
  • 1 Competency with two linked resources
  1. Log in to Artemis
  2. Navigate to Course > Competency (The DB table science_event should contain an entry for viewing the competency overview)
  3. Navigate into the Competency (The DB table science_event should contain an entry for viewing the competency)
  4. Navigate into the Learning path view (The DB table science_event should contain an entry for viewing the learning path)
  5. Click the next button (The DB table science_event should contain an entry for viewing the next task)
  6. Click the previous button (The DB table science_event should contain an entry for viewing the previous task)
  7. Click the navigation menu (center top) (The DB table science_event should contain an entry for viewing the navigation)
  8. Click the competency graph button in the navigation menu (The DB table science_event should contain an entry for viewing the competency graph)

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

unchanged

Summary by CodeRabbit

  • New Features

    • Added new event tracking for competencies and learning paths, including opening, navigation, and graph views.
  • Refactor

    • Simplified event logging by removing inheritance from abstract components and directives, centralizing logging through a dedicated service.
  • Chores

    • Removed unused abstract classes, directives, and related test files to streamline the codebase.

@MaximilianAnzinger MaximilianAnzinger requested review from a team and krusche as code owners April 24, 2025 13:34
@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Apr 24, 2025
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) atlas Pull requests that affect the corresponding module labels Apr 24, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

Walkthrough

This change extends the ScienceEventType enumeration in both backend and frontend codebases to include new event types related to competencies and learning paths. Multiple Angular components are updated to directly inject ScienceService and log relevant science events when users interact with competency and learning path features. The previously used abstract class AbstractScienceComponent and the directive ScienceDirective were removed, and components that formerly extended the abstract class were refactored to call the ScienceService directly for event logging. Additionally, two test files related to the removed abstract component and directive were deleted. These modifications add event tracking capabilities to relevant UI components without altering their core logic or data flows.

Changes

File(s) Change Summary
src/main/java/de/tum/cit/aet/artemis/atlas/domain/science/ScienceEventType.java
src/main/webapp/app/shared/science/science.model.ts
Extended the ScienceEventType enum with seven new event types for competencies and learning paths: COMPETENCY__OPEN, COMPETENCY__OPEN_OVERVIEW, LEARNING_PATH__OPEN, LEARNING_PATH__OPEN_NAVIGATION, LEARNING_PATH__NAV_NEXT, LEARNING_PATH__NAV_PREV, LEARNING_PATH__OPEN_GRAPH.
src/main/webapp/app/atlas/manage/competency-graph-modal/competency-graph-modal.component.ts Injected ScienceService and imported ScienceEventType; logged LEARNING_PATH__OPEN_GRAPH event before loading competency graph.
src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.ts Injected ScienceService and imported ScienceEventType; logged COMPETENCY__OPEN event in ngOnInit after loading competency details.
src/main/webapp/app/atlas/overview/course-competencies/course-competencies.component.ts Injected ScienceService and imported ScienceEventType; logged COMPETENCY__OPEN_OVERVIEW event in ngOnInit after extracting course ID.
src/main/webapp/app/atlas/overview/learning-path-nav-overview/learning-path-nav-overview.component.ts Injected ScienceService; logged LEARNING_PATH__OPEN_NAVIGATION event when learningPathId changes.
src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.ts Injected ScienceService and imported ScienceEventType; logged navigation events LEARNING_PATH__NAV_NEXT or LEARNING_PATH__NAV_PREV in selectLearningObject method based on navigation direction.
src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.ts Injected ScienceService and imported ScienceEventType; logged LEARNING_PATH__OPEN event after loading a learning path.
src/main/webapp/app/core/course/overview/exercise-details/course-exercise-details.component.ts Removed inheritance from AbstractScienceComponent; injected ScienceService directly; replaced superclass logging calls with direct scienceService.logEvent calls for EXERCISE__OPEN event.
src/main/webapp/app/lecture/overview/course-lectures/attachment-unit/attachment-unit.component.ts Injected ScienceService; replaced previous logging calls with scienceService.logEvent for LECTURE__OPEN_UNIT event in handleDownload and handleOriginalVersion methods.
src/main/webapp/app/lecture/overview/course-lectures/details/course-lecture-details.component.ts Removed inheritance from AbstractScienceComponent; injected ScienceService directly; replaced superclass logging calls with direct scienceService.logEvent calls for LECTURE__OPEN event.
src/main/webapp/app/lecture/overview/course-lectures/lecture-unit/lecture-unit.directive.ts Removed inheritance from AbstractScienceComponent and constructor; removed related imports; retained existing inputs, outputs, and methods without changes.
src/main/webapp/app/lecture/overview/course-lectures/online-unit/online-unit.component.ts Injected ScienceService; replaced local logEvent() calls with direct scienceService.logEvent calls for LECTURE__OPEN_UNIT event in handleIsolatedView method.
src/main/webapp/app/lecture/overview/course-lectures/text-unit/text-unit.component.ts Injected ScienceService; replaced local logEvent() calls with direct scienceService.logEvent calls for LECTURE__OPEN_UNIT event in handleIsolatedView method.
src/main/webapp/app/lecture/overview/course-lectures/video-unit/video-unit.component.ts Injected ScienceService; replaced commented-out logEvent() calls with direct scienceService.logEvent calls for LECTURE__OPEN_UNIT event in toggleCollapse method.
src/main/webapp/app/shared/science/science.component.ts Removed entire AbstractScienceComponent class including its constructor and methods setResourceId and logEvent.
src/main/webapp/app/shared/science/science.directive.ts Removed entire ScienceDirective class that logged science events on host element clicks.
src/main/webapp/app/shared/science/science.component.spec.ts Deleted unit test file for AbstractScienceComponent.
src/main/webapp/app/shared/science/science.directive.spec.ts Deleted unit test file for ScienceDirective.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AngularComponent
    participant ScienceService

    User->>AngularComponent: Interact with competency or learning path UI
    AngularComponent->>ScienceService: logEvent(eventType, resourceId)
Loading

Suggested labels

feature, athena, documentation, tests

Suggested reviewers

  • cremertim
  • ole-ve
  • HawKhiem
  • sachmii
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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
Contributor

@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

🧹 Nitpick comments (1)
src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.ts (1)

51-56: Consider consolidating conditional logic.

While the current implementation works correctly, consider placing both the resource ID setting and event logging inside the same conditional block for clarity.

 // log event
 if (learningPath) {
     this.setResourceId(learningPath.id);
+    this.logEvent();
 }
-this.logEvent();
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98baad6 and c5825ef.

📒 Files selected for processing (9)
  • src/main/java/de/tum/cit/aet/artemis/atlas/domain/science/ScienceEventType.java (1 hunks)
  • src/main/webapp/app/atlas/manage/competency-graph-modal/competency-graph-modal.component.ts (3 hunks)
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.ts (4 hunks)
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies.component.ts (2 hunks)
  • src/main/webapp/app/atlas/overview/learning-path-nav-overview/learning-path-nav-overview.component.ts (3 hunks)
  • src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.ts (3 hunks)
  • src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.ts (4 hunks)
  • src/main/webapp/app/shared/science/science.component.ts (1 hunks)
  • src/main/webapp/app/shared/science/science.model.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalC...

src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

  • src/main/webapp/app/atlas/manage/competency-graph-modal/competency-graph-modal.component.ts
  • src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.ts
  • src/main/webapp/app/atlas/overview/learning-path-nav-overview/learning-path-nav-overview.component.ts
  • src/main/webapp/app/shared/science/science.component.ts
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.ts
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies.component.ts
  • src/main/webapp/app/shared/science/science.model.ts
  • src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.ts
`src/main/java/**/*.java`: naming:CamelCase; principles:{single_responsibility,small_methods,no_duplication}; db:{perf_queries,datetime_not_timestamp}; rest:{stateless,singleton,de...

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

  • src/main/java/de/tum/cit/aet/artemis/atlas/domain/science/ScienceEventType.java
🧬 Code Graph Analysis (1)
src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.ts (1)
src/main/webapp/app/atlas/shared/entities/learning-path.model.ts (1)
  • LearningPathNavigationObjectDTO (38-46)
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: server-tests
  • GitHub Check: client-tests-selected
  • GitHub Check: client-tests
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Analyse
🔇 Additional comments (29)
src/main/java/de/tum/cit/aet/artemis/atlas/domain/science/ScienceEventType.java (1)

9-10: New event types added following naming convention.

The additions for competency and learning path event types follow the documented naming convention of <category>__<detailed event name>. These new constants align well with the PR objective of tracking interactions with competencies and learning paths for research purposes.

src/main/webapp/app/shared/science/science.component.ts (3)

10-10: Event type parameter made optional.

Making the type parameter optional allows for more flexible initialization patterns in derived components.


14-16: New method enhances flexibility.

The setScienceEventType method allows components to set the event type dynamically after construction, supporting more complex use cases where the event type isn't known at initialization time.


22-25: Defensive programming applied to prevent errors.

Adding a conditional check before calling scienceService.logEvent prevents potential runtime errors when no event type is defined. This is a good practice that makes the component more robust.

src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.ts (3)

14-15: Imports added for science event tracking.

The necessary imports are added to support the new event tracking functionality.


24-24: Component extended to support science event tracking.

The component now extends AbstractScienceComponent to enable tracking of learning path interactions, aligning with the PR objectives.


39-39: Event type specified in constructor.

The component passes ScienceEventType.LEARNING_PATH__OPEN to the parent constructor, clearly indicating its purpose for tracking when learning paths are opened.

src/main/webapp/app/atlas/overview/learning-path-nav-overview/learning-path-nav-overview.component.ts (4)

13-14: Imports added for science event tracking.

The necessary imports are added to support the new event tracking functionality.


23-23: Component extended to support science event tracking.

The component now extends AbstractScienceComponent to enable tracking of learning path navigation interactions, aligning with the PR objectives.


45-45: Event type specified in constructor.

The component passes ScienceEventType.LEARNING_PATH__OPEN_NAVIGATION to the parent constructor, clearly indicating its purpose for tracking when learning path navigation is opened.


48-51: Event tracking added to effect.

Event tracking is appropriately placed within the effect that reacts to changes in the learning path ID, ensuring events are logged when the navigation component is initialized with a new learning path.

src/main/webapp/app/shared/science/science.model.ts (1)

10-16: Correctly implemented new science event types.

The new event types for competency and learning path interactions follow the established naming convention of <category>__<detailed event name> and align perfectly with the PR objectives of tracking student interactions with competency and learning path UI components.

src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.ts (4)

45-46: Good addition of necessary science component imports.

The imports for AbstractScienceComponent and ScienceEventType are correctly added to support the event logging functionality.


72-72: Class properly extends AbstractScienceComponent.

The component now extends AbstractScienceComponent to inherit the science event logging functionality, which aligns with the PR objective of tracking competency interactions.


98-100: Constructor implementation for science event tracking.

The constructor correctly passes the COMPETENCY__OPEN event type to the parent class.


118-123: Science event logging implementation.

The resource ID is properly set to the competency ID before logging the event, ensuring accurate tracking of which competency was viewed.

src/main/webapp/app/atlas/overview/course-competencies/course-competencies.component.ts (4)

17-18: Good addition of necessary science component imports.

The imports for AbstractScienceComponent and ScienceEventType are correctly added to support the event logging functionality.


26-26: Class properly extends AbstractScienceComponent.

The component now extends AbstractScienceComponent to inherit the science event logging functionality, which aligns with the PR objective of tracking competency overview interactions.


51-53: Constructor implementation for science event tracking.

The constructor correctly passes the COMPETENCY__OPEN_OVERVIEW event type to the parent class.


61-65: Science event logging implementation.

The resource ID is properly set to the course ID before logging the event, ensuring accurate tracking of competency overview interactions within the context of a specific course.

src/main/webapp/app/atlas/manage/competency-graph-modal/competency-graph-modal.component.ts (4)

10-11: Good addition of necessary science component imports.

The imports for AbstractScienceComponent and ScienceEventType are correctly added to support the event logging functionality.


20-20: Class properly extends AbstractScienceComponent.

The component now extends AbstractScienceComponent to inherit the science event logging functionality, which aligns with the PR objective of tracking learning path competency graph interactions.


33-34: Constructor implementation for science event tracking.

The constructor correctly passes the LEARNING_PATH__OPEN_GRAPH event type to the parent class.


38-40: Science event logging implementation.

The resource ID is properly set to the learning path ID before logging the event. This implementation is placed appropriately within the effect function to ensure it runs when the learning path ID changes.

src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.ts (5)

10-11: Appropriate imports for science event tracking

These imports correctly bring in the necessary components for science event tracking, aligning with the PR's objective of adding research-focused event logging.


20-20: Well-implemented inheritance for science tracking

The component now appropriately extends AbstractScienceComponent, enabling it to log user interactions with learning path navigation. This change follows Angular best practices and the PascalCase naming convention required by the coding guidelines.


45-45: Proper parent constructor call

The call to super() is correctly implemented, which is necessary when extending a parent class.


48-48: Resource ID tracking correctly configured

The resource ID is properly set using the current learning path ID, ensuring that all logged events can be associated with the specific learning path the user is interacting with.


54-57: Well-implemented navigation event logging

The implementation correctly:

  1. Uses a clear comment to indicate the purpose of the code
  2. Sets the appropriate event type based on navigation direction
  3. Logs the event before performing the actual navigation

This approach ensures accurate tracking of user navigation patterns while maintaining the component's core functionality.

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 24, 2025
@MaximilianAnzinger MaximilianAnzinger requested a review from a team as a code owner April 24, 2025 22:25
@github-actions github-actions bot added core Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module labels Apr 24, 2025
Copy link
Contributor

@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

🧹 Nitpick comments (1)
src/main/webapp/app/lecture/overview/course-lectures/attachment-unit/attachment-unit.component.ts (1)

56-56: Consider using more specific event types for different actions.

Both handleDownload() and handleOriginalVersion() use the same event type (LECTURE__OPEN_UNIT). For research purposes, it might be beneficial to differentiate between these distinct user interactions with more specific event types.

Also applies to: 68-68

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5825ef and f32e660.

📒 Files selected for processing (17)
  • src/main/webapp/app/atlas/manage/competency-graph-modal/competency-graph-modal.component.ts (3 hunks)
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.ts (3 hunks)
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies.component.ts (3 hunks)
  • src/main/webapp/app/atlas/overview/learning-path-nav-overview/learning-path-nav-overview.component.ts (3 hunks)
  • src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.ts (3 hunks)
  • src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.ts (3 hunks)
  • src/main/webapp/app/core/course/overview/exercise-details/course-exercise-details.component.ts (4 hunks)
  • src/main/webapp/app/lecture/overview/course-lectures/attachment-unit/attachment-unit.component.ts (4 hunks)
  • src/main/webapp/app/lecture/overview/course-lectures/details/course-lecture-details.component.ts (4 hunks)
  • src/main/webapp/app/lecture/overview/course-lectures/lecture-unit/lecture-unit.directive.ts (1 hunks)
  • src/main/webapp/app/lecture/overview/course-lectures/online-unit/online-unit.component.ts (2 hunks)
  • src/main/webapp/app/lecture/overview/course-lectures/text-unit/text-unit.component.ts (3 hunks)
  • src/main/webapp/app/lecture/overview/course-lectures/video-unit/video-unit.component.ts (2 hunks)
  • src/main/webapp/app/shared/science/science.component.spec.ts (0 hunks)
  • src/main/webapp/app/shared/science/science.component.ts (0 hunks)
  • src/main/webapp/app/shared/science/science.directive.spec.ts (0 hunks)
  • src/main/webapp/app/shared/science/science.directive.ts (0 hunks)
💤 Files with no reviewable changes (4)
  • src/main/webapp/app/shared/science/science.directive.ts
  • src/main/webapp/app/shared/science/science.component.ts
  • src/main/webapp/app/shared/science/science.component.spec.ts
  • src/main/webapp/app/shared/science/science.directive.spec.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.ts
  • src/main/webapp/app/atlas/overview/learning-path-nav-overview/learning-path-nav-overview.component.ts
  • src/main/webapp/app/atlas/manage/competency-graph-modal/competency-graph-modal.component.ts
  • src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.ts
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies.component.ts
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.ts
🧰 Additional context used
📓 Path-based instructions (1)
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalC...

src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

  • src/main/webapp/app/lecture/overview/course-lectures/video-unit/video-unit.component.ts
  • src/main/webapp/app/lecture/overview/course-lectures/attachment-unit/attachment-unit.component.ts
  • src/main/webapp/app/lecture/overview/course-lectures/online-unit/online-unit.component.ts
  • src/main/webapp/app/lecture/overview/course-lectures/lecture-unit/lecture-unit.directive.ts
  • src/main/webapp/app/lecture/overview/course-lectures/details/course-lecture-details.component.ts
  • src/main/webapp/app/core/course/overview/exercise-details/course-exercise-details.component.ts
  • src/main/webapp/app/lecture/overview/course-lectures/text-unit/text-unit.component.ts
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build .war artifact
  • GitHub Check: client-style
  • GitHub Check: client-tests-selected
  • GitHub Check: server-tests
  • GitHub Check: client-tests
  • GitHub Check: server-style
  • GitHub Check: Analyse
🔇 Additional comments (11)
src/main/webapp/app/lecture/overview/course-lectures/attachment-unit/attachment-unit.component.ts (3)

25-26: LGTM: Properly injected ScienceService for event logging.

The addition of the ScienceService and ScienceEventType imports, along with the proper injection using Angular's recommended inject function, follows good practices for dependency injection.

Also applies to: 37-37


56-56: Event logging added to file download action.

The code correctly logs the LECTURE__OPEN_UNIT event when a user downloads a file, providing valuable data for the research objectives mentioned in the PR.


68-68: Event logging added to original version access.

The code correctly logs the LECTURE__OPEN_UNIT event when a user accesses the original version of a file.

src/main/webapp/app/lecture/overview/course-lectures/online-unit/online-unit.component.ts (2)

1-1: LGTM: Properly imported and injected ScienceService.

The modifications to import the required dependencies and inject the ScienceService follow Angular best practices using the recommended inject function.

Also applies to: 6-7, 17-18


20-20: Event logging added to isolated view action.

The code correctly logs the LECTURE__OPEN_UNIT event when a user opens an online resource in an isolated view, which supports the research objectives outlined in the PR.

src/main/webapp/app/lecture/overview/course-lectures/video-unit/video-unit.component.ts (2)

1-1: LGTM: Properly imported and injected ScienceService.

The additions to import the required dependencies and inject the ScienceService follow Angular best practices using the recommended inject function.

Also applies to: 8-9, 36-37


41-41: Event logging added to video expansion.

The code correctly logs the LECTURE__OPEN_UNIT event when a user expands a video unit, which aligns with the research objectives for tracking student interactions.

src/main/webapp/app/lecture/overview/course-lectures/lecture-unit/lecture-unit.directive.ts (1)

2-2: LGTM: Successfully refactored to remove AbstractScienceComponent dependency.

The directive has been properly refactored to remove the inheritance from the now-removed AbstractScienceComponent while maintaining its core functionality. This change aligns with the broader refactoring pattern where components now directly inject ScienceService instead of inheriting from a base class.

Also applies to: 7-7

src/main/webapp/app/core/course/overview/exercise-details/course-exercise-details.component.ts (1)

58-58: Great implementation of the science event logging.

The refactoring from AbstractScienceComponent to direct ScienceService injection is well implemented. This approach provides better decoupling and simplifies the component hierarchy.

Also applies to: 110-110, 184-184

src/main/webapp/app/lecture/overview/course-lectures/text-unit/text-unit.component.ts (1)

8-9: Clean implementation of science event logging.

The direct service injection approach maintains clean separation of concerns and removes the dependency on an abstract component. This is a good architectural improvement.

Also applies to: 20-20, 30-30

src/main/webapp/app/lecture/overview/course-lectures/details/course-lecture-details.component.ts (1)

39-39: Consistent implementation of science event logging.

The refactoring consistently applies the same pattern as other components, ensuring a uniform approach to event logging throughout the application. This change aligns perfectly with the PR's goal of adding event logging for research purposes.

Also applies to: 77-77, 109-109

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 24, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅SkippedFailedTime ⏱
End-to-End (E2E) Test Report1 ran1 passed0 skipped0 failed1s 604ms
TestResultTime ⏱
No test annotations available

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report201 ran196 passed3 skipped2 failed51m 29s 581ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/course/CourseMessages.spec.ts
ts.Course messages › Channel messages › Write/edit/delete message in channel › Student should be able to edit message in channel❌ failure2m 2s 718ms
e2e/exercise/programming/ProgrammingExerciseStaticCodeAnalysis.spec.ts
ts.Static code analysis tests › Configures SCA grading and makes a successful submission with SCA errors❌ failure1m 48s 412ms

coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 24, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Apr 24, 2025
raffifasaro
raffifasaro previously approved these changes Apr 24, 2025
Copy link
Contributor

@raffifasaro raffifasaro left a comment

Choose a reason for hiding this comment

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

Code LGTM

Copy link
Contributor

@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

🧹 Nitpick comments (1)
src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.spec.ts (1)

40-90: Consider adding a test for the new event logging behavior.

While the mock service is properly configured, there's no test specifically verifying that the component logs the expected COMPETENCY__OPEN event during initialization. Adding a test to verify this new behavior would improve test coverage.

You could add a test like this:

it('should log COMPETENCY__OPEN event on initialization', () => {
    const scienceService = TestBed.inject(ScienceService);
    const logEventSpy = jest.spyOn(scienceService, 'logEvent');
    
    fixture.detectChanges();
    
    expect(logEventSpy).toHaveBeenCalledWith(ScienceEventType.COMPETENCY__OPEN, expect.any(Object));
});

This would require importing ScienceEventType as well:

import { ScienceService, ScienceEventType } from 'app/shared/science/science.service';
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c74fb9d and 441abcd.

📒 Files selected for processing (7)
  • src/main/webapp/app/atlas/manage/competency-graph-modal/competency-graph-modal.component.spec.ts (2 hunks)
  • src/main/webapp/app/atlas/manage/learning-paths-table/learning-paths-table.component.spec.ts (2 hunks)
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.spec.ts (2 hunks)
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies.component.spec.ts (2 hunks)
  • src/main/webapp/app/atlas/overview/learning-path-nav-overview/learning-path-nav-overview.component.spec.ts (2 hunks)
  • src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.spec.ts (2 hunks)
  • src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.spec.ts (2 hunks)
✅ Files skipped from review due to trivial changes (4)
  • src/main/webapp/app/atlas/overview/learning-path-nav-overview/learning-path-nav-overview.component.spec.ts
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies.component.spec.ts
  • src/main/webapp/app/atlas/manage/competency-graph-modal/competency-graph-modal.component.spec.ts
  • src/main/webapp/app/atlas/manage/learning-paths-table/learning-paths-table.component.spec.ts
🧰 Additional context used
📓 Path-based instructions (1)
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalC...

src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

  • src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.spec.ts
  • src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.spec.ts
  • src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build and Push Docker Image / Build Docker Image for ls1intum/artemis
  • GitHub Check: Build .war artifact
  • GitHub Check: client-tests-selected
  • GitHub Check: client-tests
  • GitHub Check: server-tests
  • GitHub Check: Analyse
🔇 Additional comments (3)
src/main/webapp/app/atlas/overview/learning-path-student-nav/learning-path-student-nav.component.spec.ts (1)

8-9: Testing setup correctly updated for ScienceService integration.

The changes properly update the test configuration to support the new ScienceService dependency. Adding MockProvider(ScienceService) to the providers array ensures that tests will continue to run correctly with the new event logging functionality, without requiring actual service implementation.

Also applies to: 69-69

src/main/webapp/app/atlas/overview/learning-path-student-page/learning-path-student-page.component.spec.ts (1)

17-18: Well-implemented test dependency update.

The addition of ScienceService mock provider correctly supports the component's new direct dependency on this service, which aligns with the PR objective of adding event logging for learning paths. Using MockProvider from ng-mocks is an efficient approach that follows best practices for Angular testing.

Also applies to: 59-59

src/main/webapp/app/atlas/overview/course-competencies/course-competencies-details.component.spec.ts (1)

40-40: Good addition of ScienceService support.

The import and mock provider for ScienceService are correctly implemented, which aligns with the PR objective of adding event logging for competency interactions. This properly supports the corresponding component change that now injects this service to log a COMPETENCY__OPEN event during initialization.

Also applies to: 90-90

@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅SkippedFailedTime ⏱
End-to-End (E2E) Test Report1 ran1 passed0 skipped0 failed2s 161ms
TestResultTime ⏱
No test annotations available

@helios-aet helios-aet bot temporarily deployed to artemis-test3.artemis.cit.tum.de April 24, 2025 23:46 Inactive
@MaximilianAnzinger MaximilianAnzinger added this to the 8.0.2 milestone Apr 24, 2025
@MaximilianAnzinger MaximilianAnzinger moved this to In review in Atlas Apr 24, 2025
Copy link
Contributor

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

@MaximilianAnzinger MaximilianAnzinger merged commit 4e1b7fb into develop Apr 24, 2025
27 of 31 checks passed
@MaximilianAnzinger MaximilianAnzinger deleted the feature/science/add-collected-data branch April 24, 2025 23:57
@github-project-automation github-project-automation bot moved this from Work In Progress to Merged in Artemis Development Apr 24, 2025
@github-project-automation github-project-automation bot moved this from In review to Done in Atlas Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

atlas Pull requests that affect the corresponding module client Pull requests that update TypeScript code. (Added Automatically!) core Pull requests that affect the corresponding module lecture Pull requests that affect the corresponding module server Pull requests that update Java code. (Added Automatically!)

Projects

Archived in project
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants