dragonsbootcampllc / DragonsBootcampLMS

6 stars 0 forks source link

Create UserLectureProgress and UserTaskProgress Models #63

Closed AhmedNagehAbdelrazek closed 2 months ago

AhmedNagehAbdelrazek commented 2 months ago

Implement two new models, UserLectureProgress and UserTaskProgress, to track the user's progress in lectures and tasks. Ensure that the controllers for courses, lectures, and tasks are updated to incorporate these new models.

Create UserLectureProgress Model

Table Name: user_lecture_progress
Columns:
    id: ID (Primary Key)
    user_id: ID (Foreign Key to User)
    lecture_id: ID (Foreign Key to Lecture)
    progress: Float (0.0 to 1.0 representing completion percentage it is based on the tasks finished and lecture attended)
    attended: Boolean
    completion_date: DateTime (Optional)

Create UserTaskProgress Model

Table Name: user_task_progress
Columns:
    id: ID (Primary Key)
    user_id: ID (Foreign Key to User)
    task_id: ID (Foreign Key to Task)
    finished: Boolean
    completion_date: DateTime (Optional)

Update Course, Lecture, and Task Controllers

Ensure that the controllers handle CRUD operations related to the progress tracking 
in the UserLectureProgress and UserTaskProgress models.
Implement logic to update progress automatically when a user completes a lecture or task.
Add validation to ensure that users can only update progress for lectures and tasks they are enrolled in or assigned to.
ahmedehab0 commented 2 months ago

I have already implemented the "UserTaskProgress" model as part of my issue "calculate average task progress in course".