Skip to content

Implement API for Learner Progress#116

Open
ji-mmyliu wants to merge 12 commits intomainfrom
jimmy-harishan/learner-progress
Open

Implement API for Learner Progress#116
ji-mmyliu wants to merge 12 commits intomainfrom
jimmy-harishan/learner-progress

Conversation

@ji-mmyliu
Copy link
Copy Markdown
Collaborator

@ji-mmyliu ji-mmyliu commented Apr 10, 2025

Notion ticket link

Learner Course Progress Tracking

Implementation description

  • Added an activitiesCompleted field for learners that specifies the object IDs of course pages that a learner has viewed (or completed if it's an activity)
    • Added API endpoints for marking a page as completed and also querying the learner's progress (including a full list of the modules that they have completed)
  • Added a nextPage field to track the next page that the learner should be directed to when they return to the site
    • Added an API endpoint for marking the most recently viewed page. This will calculate and update the nextPage field.

Steps to test

  1. Try playing around with the API endpoints to ensure their functionality. Namely: PUT /users/learner/markActivityCompleted, GET /users/learner/progress, and PUT /users/learner/viewedPage

What should reviewers focus on?

  • Functionality and structure of the code, including edge cases or foreseeable issues when implementing the frontend

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • backend/package.json: Language not supported
Comments suppressed due to low confidence (2)

backend/types/userTypes.ts:44

  • The 'activitiesCompleted' field in LearnerDTO uses string arrays, but the corresponding field in the user model uses ObjectId arrays. Consider aligning these types or clearly documenting the conversion to ensure consistency.
+  activitiesCompleted: Map<string, Map<string, string[]>>;

backend/services/implementations/courseModuleService.ts:66

  • The identifier 'Schema' is used in fetchPage without a corresponding import. Import 'Schema' from 'mongoose' (or reference mongoose.Schema) to avoid runtime errors.
  private static async fetchPage(page: Schema.Types.ObjectId): Promise<CoursePage> {

Comment thread backend/services/implementations/userService.ts
@ji-mmyliu ji-mmyliu force-pushed the jimmy-harishan/learner-progress branch from 137c89c to 3db7130 Compare April 10, 2025 03:26
@ji-mmyliu ji-mmyliu force-pushed the jimmy-harishan/learner-progress branch from 3a3541c to 3024ba0 Compare July 28, 2025 23:46
@ji-mmyliu ji-mmyliu force-pushed the jimmy-harishan/learner-progress branch from 465b4ac to a88a5eb Compare July 29, 2025 00:32
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