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

API for viewing submissions and leaderboard #90

Merged
merged 3 commits into from
Dec 27, 2020

Conversation

cjchirag7
Copy link
Collaborator

@cjchirag7 cjchirag7 commented Dec 23, 2020

The following API's are completed-

  • getAllSubmissions
    GET /contests/:contest_id/submissions Contest Moderator only: See all submissions (pagination, sorting, filtering and searching enabled)

  • getUserContestSubmissions
    GET /contests/:contest_id/users/:user_id/submissions The user only: get all submissions of a user

  • gradeSubjectiveSubmission
    POST /contests/:contest_id/subjective_submissions/:submission_id/grade Contest Moderator only: Grade a subjective submission providing a score along with an optional feedback. (If submission is already judged/graded, update it)

  • getMCQSubmission
    GET /contests/:contest_id/mcq_submissions/:submission_id Only the specific user: Get a specific MCQ submission
    GET /contests/:contest_id/mcq_submissions/:submission_id?moderator=true Contest Moderator only: Get a specific MCQ submission

  • getSubjectiveSubmission
    GET /contests/:contest_id/subjective_submissions/:submission_id Only the specific user: Get a specific subjective submission.
    GET /contests/:contest_id/subjective_submissions/:submission_id?moderator=true Contest Moderator only: Get a specific subjective submission

  • getContestLeaderboard
    GET /contests/:contest_id/leaderboard All participants: Everyone should be allowed, if show_leaderboard is true, otherwise allow only contest moderators.

  • getQuestionLeaderboard
    GET /contests/:contest_id/questions/:question_id/leaderboard:Everyone should be allowed, if show_leaderboard is true, otherwise allow only contest moderators.

#60

@cjchirag7
Copy link
Collaborator Author

Maybe, it's better if I send a PR after this, for schema validation of some of these endpoints, because the endpoints which contain pagination involve a lot of query params and if invalid, may cause many errors.

Copy link
Collaborator

@ridhishjain-zepto ridhishjain-zepto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine to me
lets wait for @NBNARADHYA

Copy link
Contributor

@NBNARADHYA NBNARADHYA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes regarding count; Since it has expensive checks, it can be made better using multiple statement queries. Also, follow this guide for getting count without making more checks

Copy link
Contributor

@NBNARADHYA NBNARADHYA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change this to multiple statements query if performance is slow later on. For now, LGTM !

@ridhishjain-zepto ridhishjain-zepto merged commit aea784a into Cyber-Labs:master Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants