Skip to content

Solving all High-Priority issues #14

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

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

naveen28204280
Copy link

Addresses Issue

  1. Grace Period Logic for Task Submission
  2. Auto Calculate Time-Taken Per Task
  3. Reduce Points for late submission
  4. Mark Overdue Tasks Automatically

How Issues Were Solved

  1. Added two columns called pause_start and total_paused_time, every time a pause starts, it's stored in pause_start and then when pause stops, the paused time is added to total_paused_time
  2. Uses crud.find_time_taken_per_task (which does submitted_at - start_date - total_paused_time or now - start_date - total_paused_date if the task hasn't been submitted yet) to calculate the no of days spent on a particular task by certain mentee
  3. Added a check to see if it's overdue and adds reduced marks for late submissions
  4. Uses the 2nd to note their status and then displays in /{track_id}/tasks along side all the other task details

@hrideshmg
Copy link
Member

hrideshmg commented May 31, 2025

Hey Naveen, please use the closes format for linking issues: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue

@ganidande905
Copy link
Member

ganidande905 commented Jun 2, 2025

Hey, I just went through your PR and the changes look good overall.
I added your remote and tested things out, the API is failing at the task submission step with an internal server error. Can you take a look and fix it?

Also, could you explain how the progress endpoints are working? Would be helpful to understand the flow.

Can you also tag all the issues being solved by this PR too.

Tip: It’s always better to have different PRs for different issues

@naveen28204280
Copy link
Author

naveen28204280 commented Jun 3, 2025

The latest commit should solve the issues in all the endpoints except approve-task and submit-task as I still need implement reject task to it.
I also had to change Submissions.reference_link to nullable=True in order to allow mentees to start task. Please the DB accordingly

@naveen28204280
Copy link
Author

Alright, I'll be ignoring submit-task and approve-task as I'll be sending a different PR for them

/start-task

We get the task and mentee using crud.get_user_by_email and crud.get_task. Then we check if the task has already been started by that mentee by using crud.get_submission. If it has been started then it raises an HttpException and if it hasn't been then crud.start_task is called which creates a new row in the Submissions table and sets the mentee_id, task_id, and start_date=datetime.now() and status = "ongoing"

/pause-task

We verify mentor-mentee using crud.is_mentor_of. If it isn't the correct mentor then it raises an HttpException else we get the task details as well and use crud.pause_start for the actual pausing, which then finds the submission and then sets its pause_start to now() and changes the status to paused

/pause-end

Much like /pause-task , this also verifies the mentor-mentee mapping then checks if the task has been paused or not. At which point it calls the crud.end_pause function which adds (now() - pause_start).days to total_paused_time and changes the status to "ongoing" before setting pause_start back to None

@naveen28204280
Copy link
Author

/review-tasks works but my /submit-task and /start-task are still in it. Someone please remove them and replace them with @ganidande905 's endpoints

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.

3 participants