Closed ZeyuanLi16 closed 1 year ago
Update: I pushed some initial logic for route and service functions. The route has not been finished but I want some input from @seidior .
There are state and due date check in BOTH route and service function, for example if it is in progress and past due date, set state to expired. I think this is valid since we need to have a safe guard in service function too in case other route call it.
Agreed!
I am thinking we need to calculate score some where between route or service function.
Assume we're given the correct score. As long as it's a facilitator submitting any grading-related information, assume they know what's best and don't worry about the checks.
Describe the Feature / Enhancement
The
PUT /submissions/:submissionId
route needs to be implemented and fully tested. ThePUT /submissions/:submissionId
updates details for a specific assessment submission (for facilitator, scores and grading comments; for participant, responses and metadata if not expired).There needs to be a test coverage for the
PUT /submissions/:submissionId
route and the service file functions it needs. We need to test this route to ensure the code written for the test will behave as expected by the protocol we previously defined.This issue continues the work from issue #515.
Additional Details and Resources
This route requires the principal ID (the user ID) from the session information, this route expects an assessment submission ID in the URL as a URL parameter, and expects an AssessmentSubmission in the request body, including all AssessmentResponses, which may or may not be individually updated. The response should contain the following:
Facilitator
The facilitator is always allowed to update an AssessmentSubmission and its responses to insert scores and grading comments.
Participant
If the AssessmentSubmission is in the "Opened" or "In Progress" states and the due date for this program assessment has not passed, return the following after having set the state to "In Progress" and updating the submission and responses (disallowing them to update their scores or graderResponse in the update to the submission or its responses):
If the AssessmentSubmission is in the "Opened" or "In Progress" states and the due date for this program assessment has passed, set the state to "Expired" and send them a ForbiddenError.
If the AssessmentSubmission is in a state besides "Opened" or "In Progress", send them a ForbiddenError.
Correct Project Selected
Labels