Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenge Submissions #65

Open
mohamed040406 opened this issue Nov 22, 2021 · 0 comments
Open

Challenge Submissions #65

mohamed040406 opened this issue Nov 22, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mohamed040406
Copy link
Contributor

mohamed040406 commented Nov 22, 2021

Endpoints

GET @ /challenges/{id}/submissions

Gets a list of submitted solutions for said challenge.

Only available if the challenge has ended (now() >= released_at + interval '7' days) or if the user has ManageSubmissions permission.

Submission Object should be something like this:

{
  "id": "string",
  "challenge_id": "string",
  "author_id": "string",
  "author": {
    "id": "string",
    "name": "string",
    "avatar": "string",
    "discriminator": "string"
  },
  "language": {
    "id": "string",
    "name": "string"
  },
  "code": "string"
}

Pagination Required


GET @ /challenges/{id}/submissions/{user_id/submission_id}

GET @ /challenges/{id}/submissions/@me should also be available

Gets a submission for said user by their user id or submission id.
Submission Object should be the same as the one in GET @ /challenges/{id}/submissions

One of the following conditions should be true for this endpoint to be available:

  • If the user is the author of the submission
  • If the challenge has ended
  • If the user has ManageSubmissions permission

POST @ /challenges/{id}/submissions

Creates a new submission for said challenge. Returns 201 Created on success and return id in Location header.

Body

{
  "language": "string",
  "code": "string"
}

DELETE @ /challenges/{challenge_id}/submissions/{id}

Deletes said submission from said challenge. Returns 204 No Content on success.

Needs ManageSubmissions Permission

@mohamed040406 mohamed040406 added enhancement New feature or request good first issue Good for newcomers labels Nov 22, 2021
@mohamed040406 mohamed040406 added this to the Initial Release milestone Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant