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

Change team to user for default validator #268

Merged
merged 1 commit into from
Jul 24, 2024
Merged
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
10 changes: 5 additions & 5 deletions support/default_validator/default_validator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ FILE *openfeedback(const char *feedbackdir, const char *feedback, const char *wh
return res;
}

const char *USAGE = "Usage: %s judge_in judge_ans feedback_file [options] < team_out";
const char *USAGE = "Usage: %s judge_in judge_ans feedback_file [options] < user_out";

int main(int argc, char **argv) {
if(argc < 4) {
Expand Down Expand Up @@ -128,7 +128,7 @@ int main(int argc, char **argv) {
while (isspace(std::cin.peek())) {
char d = (char)std::cin.get();
if (space_change_sensitive) {
wrong_answer("Space change error: judge out of space, got %d from team", d);
wrong_answer("Space change error: judge out of space, got %d from user", d);
}
if (d == '\n') ++stdin_line;
++stdin_pos;
Expand All @@ -148,16 +148,16 @@ int main(int argc, char **argv) {
}
if(!(fabs(jval - tval) <= float_abs_tol) &&
!(fabs(jval - tval) <= float_rel_tol*fabs(jval))) {
wrong_answer("Too large difference.\n Judge: %s\n Team: %s\n Difference: %le\n (abs tol %le rel tol %le)",
wrong_answer("Too large difference.\n Judge: %s\n User: %s\n Difference: %le\n (abs tol %le rel tol %le)",
judge.c_str(), team.c_str(), jval-tval, float_abs_tol, float_rel_tol);
}
} else if (case_sensitive) {
if (strcmp(judge.c_str(), team.c_str()) != 0) {
wrong_answer("String tokens mismatch\nJudge: \"%s\"\nTeam: \"%s\"", judge.c_str(), team.c_str());
wrong_answer("String tokens mismatch\nJudge: \"%s\"\nUser: \"%s\"", judge.c_str(), team.c_str());
}
} else {
if(strcasecmp(judge.c_str(), team.c_str()) != 0) {
wrong_answer("String tokens mismatch\nJudge: \"%s\"\nTeam: \"%s\"", judge.c_str(), team.c_str());
wrong_answer("String tokens mismatch\nJudge: \"%s\"\nUser: \"%s\"", judge.c_str(), team.c_str());
}
}
judgeans_pos += judge.length();
Expand Down