mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 17:38:19 +08:00
vjudge: add state check
This commit is contained in:
1 parent
f5e4b5c50a
commit
481bf3fe3a
2 files changed
+18
-16
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/vjudge",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"description": "Submit problems to remote oj",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -136,21 +136,23 @@ export default class LuoguProvider implements IBasicProvider {
|
||||
logger.info('Fetched with length', JSON.stringify(body).length);
|
||||
const total = flattenDeep(body.currentData.testCaseGroup).length;
|
||||
// TODO sorted
|
||||
for (const subtask of data.detail?.judgeResult?.subtasks || []) {
|
||||
for (const cid of Object.keys(subtask.testCases)) {
|
||||
if (done[`${subtask.id}.${cid}`]) continue;
|
||||
done[`${subtask.id}.${cid}`] = true;
|
||||
const testcase = subtask.testCases[cid];
|
||||
await next({
|
||||
status: STATUS.STATUS_JUDGING,
|
||||
case: {
|
||||
status: STATUS_MAP[testcase.status],
|
||||
time: testcase.time,
|
||||
memory: testcase.memory,
|
||||
message: testcase.description,
|
||||
},
|
||||
progress: (Object.keys(done).length / total) * 100,
|
||||
});
|
||||
if (data.detail.judgeResult) {
|
||||
for (const subtask of data.detail.judgeResult?.subtasks || []) {
|
||||
for (const cid of Object.keys(subtask.testCases)) {
|
||||
if (done[`${subtask.id}.${cid}`]) continue;
|
||||
done[`${subtask.id}.${cid}`] = true;
|
||||
const testcase = subtask.testCases[cid];
|
||||
await next({
|
||||
status: STATUS.STATUS_JUDGING,
|
||||
case: {
|
||||
status: STATUS_MAP[testcase.status],
|
||||
time: testcase.time,
|
||||
memory: testcase.memory,
|
||||
message: testcase.description,
|
||||
},
|
||||
progress: (Object.keys(done).length / total) * 100,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.status < 2) continue;
|
||||
|
||||
Reference in new issue
Block a user