mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2025-02-17 15:56:42 +00:00
feat(remote_judger/luogu): judge status
This commit is contained in:
parent
3a0bb632b8
commit
a59c8f778f
@ -380,8 +380,8 @@ export default class LuoguProvider implements IBasicProvider {
|
|||||||
let fail = 0;
|
let fail = 0;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
||||||
while (count < 180 && fail < 10) {
|
while (count < 360 && fail < 10) {
|
||||||
await sleep(1000);
|
await sleep(500);
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -398,7 +398,7 @@ export default class LuoguProvider implements IBasicProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result.status == 204) {
|
if (result.status == 204) {
|
||||||
await next({});
|
await next({ status: '[Luogu] Judging' });
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -458,7 +458,22 @@ export default class LuoguProvider implements IBasicProvider {
|
|||||||
|
|
||||||
if (!data.detail.judgeResult?.subtasks) continue;
|
if (!data.detail.judgeResult?.subtasks) continue;
|
||||||
|
|
||||||
await next({});
|
const finishedTestCases = Object.entries(
|
||||||
|
data.detail.judgeResult.subtasks
|
||||||
|
)
|
||||||
|
.map(o => o[1])
|
||||||
|
.reduce(
|
||||||
|
(acc: number, sub: any) =>
|
||||||
|
acc +
|
||||||
|
Object.entries(sub.testCases as any[])
|
||||||
|
.map(o => o[1])
|
||||||
|
.filter(test => test.status >= 2).length,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
await next({
|
||||||
|
status: `[Luogu] Judging (${finishedTestCases} judged)`,
|
||||||
|
});
|
||||||
|
|
||||||
if (data.status < 2) continue;
|
if (data.status < 2) continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user