apluslms / a-plus

A+ frontend portal - A+ LMS documentation:
https://apluslms.github.io/
Other
67 stars 72 forks source link

Course points API endpoint should contain points for all submissions #647

Closed markkuriekkinen closed 4 years ago

markkuriekkinen commented 4 years ago

This comes from the IntelliJ project: https://github.com/Aalto-LeTech/intellij-plugin/issues/302

The /api/v2/courses/<course-id>/points/me/ endpoint should be able to provide points for all submissions (for one student in all exercises of one course). We need to still consider if all points are always included in the output or only when some parameter is given in the request GET query parameters. All points should already be available in the points cache: https://github.com/apluslms/a-plus/blob/9e595a0a902d19bcadeeaff8b3160873b0265f43/exercise/cache/points.py#L98

Let's not modify the existing submissions URL list in order to preserve backwards-compatibility. A new key shall be added to the output.

Example snippet for the output (the existing submissions list only contains the URLs of the submissions):

"submissions_and_points": [
  {
    "url": "https://plus.cs.aalto.fi/api/v2/submissions/123/",
    "points": 10
  },
  {
    "url": "https://plus.cs.aalto.fi/api/v2/submissions/456/",
    "points": 5
  }
]

Jaakko says that it could be best to add the grade field to the existing SubmissionBriefSerializer class. It could be more uniform with the rest of the API.

markkuriekkinen commented 4 years ago

Closing. The PR was merged to the hotfix branch first.