OpenTree-Education / rhizone-lms

A learning management system focused on self-reflection.
https://rhi.zone
BSD 3-Clause Clear License
14 stars 7 forks source link

#506 api routes create routes of assessmentsRouter.ts #509

Closed kaiyolau closed 1 year ago

kaiyolau commented 1 year ago

Proposed changes

This pull request resolves #506 by adding routes to support the assessment feature within the api backend. These routes are defined both by path and by HTTP verbs as seen below:

Verb Route Participant Action Facilitator Action
GET /assessments Get the list of all available assessments for all programs in which they are enrolled. Get the list of all available assessments for all programs in which they are enrolled.
POST /assessments ERR 403 Creates a new assessment into the system
GET /assessments/:id Get the meta information about the assessment (title, list of submission ids, due date, etc) Get the meta information about the assessment (title, list of mentees that have submissions and their submission ids, due date, etc)
PUT /assessments/:id ERR 403 Edits an assessment in the system
DELETE /assessments/:id ERR 403 “Deletes” an assessment in the system
GET /assessments/:id/submission/:id If it’s theirs: returns the submission information (metadata, answers, etc) If it’s not theirs: ERR 403 Returns the submission information (metadata, answers, etc)
PUT /assessments/:id/submission/:id Submits their answers for this submission Submits comments for the submission.
GET /assessments/:id/submission/new Creates a new (draft) submission (which starts the timer) and returns the questions and possible answers and the submission ID number Creates a new (draft) submission (which starts the timer) and returns the questions and possible answers
GET /programs/:id/certificate/:principal_id Gets the completion certificate info for that program for that participant. Gets the completion certificate for that program for that participant.

Checklist

mcharrod commented 1 year ago

Hi Spencer! I have added in the changes you requested, I love how you are so detail oriented and can map out in your head the future of the project and spot things to do now to save time. Thanks for the direct feedback, I hope this addresses everything! Please let me know if there's anything I can do to make it better. A thought, since these behaviours will be the basis for the documentation, would you like me to differentiate mentee-behaviour and mentor-behaviour?

seidior commented 1 year ago

A thought, since these behaviours will be the basis for the documentation, would you like me to differentiate mentee-behaviour and mentor-behaviour?

Thank you for the feedback, @mcharrod! Much appreciated. I don't think we need to in the code; that much will be obvious once we start building out the functions. I think the table up top in the "Proposed Changes" section will be enough for now!

Your code is still failing the yarn delint check; specifically programsRouter.ts has some changes. Please re-run that, commit it, and push it and I'll change my review to approve. Thanks!