Skip to content

Leaderboard and evaluator service. #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions evaluator/evaluator.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";

package evaluator;
import "submission/submission.proto";

option go_package="github.com/cpjudge/cpjudge_webserver";
service Evaluator{
rpc EvaluateCode (submission.Submission) returns (CodeStatus) {};
}

// Ref: https://www.quora.com/What-is-WA-RTE-CTE-and-TLE-on-CodeChef
enum EvaluationStatus {
CORRECT_ANSWER = 0;
WRONG_ANSWER = 1;
TIME_LIMIT_EXCEEDED = 2;
COMPILATION_ERROR = 3;
RUNTIME_ERROR = 4;
}

message CodeStatus {
EvaluationStatus code_status = 1;
}
21 changes: 21 additions & 0 deletions leaderboard/leaderboard.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
syntax="proto3";

service Leaderboard{
// Returns Participants in sorted order for each Contest
rpc GetLeaderboard (stream Contest) returns (stream Participants) {};
}

message Contest{
string contest_id = 1;
}

message Participants{
repeated Participant participant = 2;
}

message Participant{
string user_id = 3;
string username = 4;
int32 rating = 5;
int32 no_of_questions = 6;
}
11 changes: 4 additions & 7 deletions submission/submission.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@ message Submission {

// Ref: https://www.quora.com/What-is-WA-RTE-CTE-and-TLE-on-CodeChef
enum SubmissionStatus {
CORRECT_ANSWER = 0;
WRONG_ANSWER = 1;
TIME_LIMIT_EXCEEDED = 2;
COMPILATION_ERROR = 3;
RUNTIME_ERROR = 4;
TO_BE_EVALUATED = 5;
TIME_LIMIT_EXCEEDED = 0;
COMPILATION_ERROR = 1;
TO_BE_EVALUATED = 2;
}

message CodeStatus {
SubmissionStatus code_status = 1;
SubmissionStatus code_status = 2;
}