Skip to content

Conversation

@KAMALDEEN333
Copy link
Contributor

bytechain

📌 Pull Request Title

Description

Created a Track granular lesson engagement per user, including time spent and quiz performance. Expose backend endpoints to retrieve analytics for dashboards or profile pages.

Created module: analytics.module.ts, analytics.service.ts, analytics.controller.ts.

Track:
lesson_start_time, lesson_end_time (calculate duration).
Quiz score per attempt.

Implemented the following endpoints:
POST /analytics/lesson-start
POST /analytics/lesson-end
POST /analytics/quiz-score
GET /analytics/user/:userId

Used decorators to auto-fetch user from JWT.
Ensured analytics data is stored efficiently (via new lesson_analytics and quiz_analytics entities).

Testing:
Wrote Unit tests for duration and score tracking logic.
Integration tests for each endpoint.
Performance test for GET /analytics/user/:userId with multiple lessons.

Related Issues

Changes Made

  • List key changes made in this PR.

How to Test

npm run test -- src/modules/analytics/analytics.service.spec.ts src/modules/analytics/analytics.controller.spec.ts src/modules/analytics/analytics.e2e-spec.ts src/modules/analytics/analytics.performance.spec.ts

Screenshots (if applicable)

byteserver

Checklist

  • My code follows the project's coding style.
  • I have tested these changes locally.
  • Documentation has been updated where necessary.

Copy link
Contributor

@portableDD portableDD left a comment

Choose a reason for hiding this comment

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

please removel the analytics resources inside module and place it directly inside src, and delete the module folder.

thanks

@KAMALDEEN333
Copy link
Contributor Author

KAMALDEEN333 commented Jun 4, 2025

it has been Adjusted

Copy link
Contributor

@portableDD portableDD left a comment

Choose a reason for hiding this comment

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

LGTM

@portableDD portableDD merged commit c646ec7 into Nexacore-Org:main Jun 4, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants