mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: hide message when detail=false
This commit is contained in:
2 files changed
+5
-3
No files matched your search
@@ -28,6 +28,7 @@ function judgeCase(c: NormalizedCase) {
|
||||
let { status } = res;
|
||||
let message: any = '';
|
||||
let score = 0;
|
||||
const detail = ctx.config.detail ?? true;
|
||||
if (status === STATUS.STATUS_ACCEPTED) {
|
||||
if (time > c.time) {
|
||||
status = STATUS.STATUS_TIME_LIMIT_EXCEEDED;
|
||||
@@ -42,11 +43,11 @@ function judgeCase(c: NormalizedCase) {
|
||||
user_stdout: fileIds.stdout ? { fileId: fileIds.stdout } : { content: '' },
|
||||
user_stderr: fileIds.stderr ? { fileId: fileIds.stderr } : { content: '' },
|
||||
score: c.score,
|
||||
detail: ctx.config.detail ?? true,
|
||||
detail,
|
||||
env: { ...ctx.env, HYDRO_TESTCASE: c.id.toString() },
|
||||
}));
|
||||
}
|
||||
} else if (status === STATUS.STATUS_RUNTIME_ERROR && code) {
|
||||
} else if (status === STATUS.STATUS_RUNTIME_ERROR && code && detail) {
|
||||
if (code < 32 && signalled) message = signals[code];
|
||||
else message = { message: 'Your program returned {0}.', params: [code] };
|
||||
}
|
||||
|
||||
@@ -37,11 +37,12 @@ function judgeCase(c: NormalizedCase) {
|
||||
let status: number;
|
||||
let score = 0;
|
||||
let message: any = '';
|
||||
const detail = ctx.config.detail ?? true;
|
||||
if (time > c.time) {
|
||||
status = STATUS.STATUS_TIME_LIMIT_EXCEEDED;
|
||||
} else if (memory > c.memory * 1024) {
|
||||
status = STATUS.STATUS_MEMORY_LIMIT_EXCEEDED;
|
||||
} else if ((code && code !== 13/* Broken Pipe */) || (code === 13 && !resInteractor.code)) {
|
||||
} else if (detail && ((code && code !== 13/* Broken Pipe */) || (code === 13 && !resInteractor.code))) {
|
||||
status = STATUS.STATUS_RUNTIME_ERROR;
|
||||
if (code < 32 && signalled) message = signals[code];
|
||||
else message = { message: 'Your program returned {0}.', params: [code] };
|
||||
|
||||
Reference in new issue
Block a user