Skip to content

Sphurthy - fix: Assign Lesson Plan - Backend API and Logic#1813

Closed
sphurthy wants to merge 1 commit intodevelopmentfrom
sphurthy-assign-tasks
Closed

Sphurthy - fix: Assign Lesson Plan - Backend API and Logic#1813
sphurthy wants to merge 1 commit intodevelopmentfrom
sphurthy-assign-tasks

Conversation

@sphurthy
Copy link
Copy Markdown

@sphurthy sphurthy commented Oct 16, 2025

Description

1

Related PRS (if any):

None

Main changes explained:

  • Added new API: POST /api/educator/assign-tasks to assign lesson plan tasks.
  • Implemented prerequisite check to assign tasks only to eligible students.
  • Created task entries in StudentTasks with status = incomplete and calculated deadlines.
  • Updated StudentAtoms to in_progress upon assignment.
  • Added structured API response with success, skipped, and error details.
  • Introduced utility for deadline calculation based on assignment date.

How to test:

  1. Setup
  • Checkout branch
  • npm install && npm run build && npm start
  • Clear browser cache
  1. Test Flow
  • Use valid lesson_plan_id and assignment_date
  • Trigger API call manually (Postman) or through UI flow (if available)
  1. Verify DB Changes
  • StudentTasks populated correctly
  • Deadlines calculated correctly
  • StudentAtoms updated to in_progress

Screenshots or videos of changes:

2

Notes:

CLOSED: Updated PR: #2145

@one-community one-community changed the title fix: Assign Lesson Plan - Backend API and Logic Sphurthy - fix: Assign Lesson Plan - Backend API and Logic Nov 20, 2025
@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Nov 20, 2025
Copy link
Copy Markdown
Contributor

@bhanuanishakkineni bhanuanishakkineni left a comment

Choose a reason for hiding this comment

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

Hello Sphurthy,
I have reviewed and tested this PR. Here are the steps I have done.
Firstly, I have choose a lesson_plan_id from the database and using postman, requested API
POST /api/educator/assign-tasks to assign tasks to students.
image
image
Second, for the lesson_plan_id, I sent a GET request to api/educator/assignments/:lessonPlanId using postman to see if students were assigned the tasks.
image
I am not sure if the steps I did are correct. Initially, I am confused about how to create new lesson_plan. Hence I used existing lesson_plan. Please reply to this comment if my tests are valid.

@sphurthy
Copy link
Copy Markdown
Author

sphurthy commented Dec 5, 2025

Hello Sphurthy, I have reviewed and tested this PR. Here are the steps I have done. Firstly, I have choose a lesson_plan_id from the database and using postman, requested API POST /api/educator/assign-tasks to assign tasks to students. image image Second, for the lesson_plan_id, I sent a GET request to api/educator/assignments/:lessonPlanId using postman to see if students were assigned the tasks. image I am not sure if the steps I did are correct. Initially, I am confused about how to create new lesson_plan. Hence I used existing lesson_plan. Please reply to this comment if my tests are valid.

Hello,
The tests you conducted are valid. Thank you for testing this.

@sphurthy
Copy link
Copy Markdown
Author

sphurthy commented Apr 3, 2026

This PR has been redone in PR: #2145

@sphurthy sphurthy closed this Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants