Add API Endpoints to create problems and query/update scores for an assessment#1639
Add API Endpoints to create problems and query/update scores for an assessment#1639
Conversation
victorhuangwq
left a comment
There was a problem hiding this comment.
Tested API endpoints locally. Left comments on the scenarios that doesn't work
|
The API allows for problems with the same name, and for scores that exceeds the max score because this seems to be the existing behavior using the Autolab website. |
victorhuangwq
left a comment
There was a problem hiding this comment.
Some initial comments
victorhuangwq
left a comment
There was a problem hiding this comment.
Tested and all endpoints works as expected. Good work.
Approved PR as it is functionally correct, but I left a comment on how we are naming the endpoints.
config/routes.rb
Outdated
| resources :scores, only: [:index, :show], | ||
| param: :email, :constraints => { :email => /[^\/]+/ } | ||
|
|
||
| put "scores/:email", :constraints => { :email => /[^\/]+/ }, to: "scores#update_latest" |
There was a problem hiding this comment.
I don't think we should repurpose
scores:/email to update latest, but perhaps create something like scores/:email/update-latest.
Because if we are putting scores:/email, we should be going with the default update behavior, not update_latest.





Description
Created POST /courses/{course_name}/assessments/{assessment_name}/problems
Created GET /courses/{course_name}/assessments/{assessment_name}/scores
Created GET /courses/{course_name}/assessments/{assessment_name}/scores/{email}
Created PUT /courses/{course_name}/assessments/{assessment_name}/scores/{email}
Motivation and Context
Endpoints created by request to allow more robust types of assessments.
How Has This Been Tested?
Setup Oauth Access
Navigate to /oauth/applications and click 'New Application'
Setup Postman

Scroll down to 'Configure New Token'
Create new request for each of the following requests
POST /courses/{course_name}/assessments/{assessment_name}/problems
GET /courses/{course_name}/assessments/{assessment_name}/scores
GET /courses/{course_name}/assessments/{assessment_name}/scores/{email}
PUT /courses/{course_name}/assessments/{assessment_name}/scores/{email}
{email}and add another student{email}{email}'s score on most recent submission was updatedproblem3for this assessment{email}'s score on the most recent submission was not updated"error": "'problem3' not found in this assessment""error": "'problem3' not found in this assessment"Types of changes
Checklist:
overcommit --install && overcommit --signto use pre-commit hook for linting