vjudge: add state check

This commit is contained in:
undefined committed 2021-09-17 00:24:14 +08:00
1 parent f5e4b5c50a
commit 481bf3fe3a
2 files changed
+4 -2

No files matched your search

+1 -1
View File
@@ -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",
+3 -1
View File
@@ -136,7 +136,8 @@ 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 || []) {
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;
@@ -153,6 +154,7 @@ export default class LuoguProvider implements IBasicProvider {
});
}
}
}
if (data.status < 2) continue;
logger.info('RecordID:', id, 'done');
// TODO calc total status