mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
修复分数为0时不会自动更新成绩的问题,添加旧版测试数据格式兼容
This commit is contained in:
1 parent
e1cfe1cf4d
commit
441515297a
7 files changed
+70
-32
No files matched your search
@@ -57,10 +57,10 @@ export async function next(body: JudgeResultBody) {
|
||||
$push.compilerTexts = body.compilerText;
|
||||
}
|
||||
if (body.status) $set.status = body.status;
|
||||
if (body.score) $set.score = body.score;
|
||||
if (body.time) $set.time = body.time;
|
||||
if (body.memory) $set.memory = body.memory;
|
||||
if (body.progress) $set.progress = body.progress;
|
||||
if (body.score !== undefined) $set.score = body.score;
|
||||
if (body.time !== undefined) $set.time = body.time;
|
||||
if (body.memory !== undefined) $set.memory = body.memory;
|
||||
if (body.progress !== undefined) $set.progress = body.progress;
|
||||
rdoc = await record.update(body.domainId, body.rid, $set, $push);
|
||||
bus.boardcast('record/change', rdoc, $set, $push);
|
||||
}
|
||||
@@ -80,11 +80,11 @@ export async function end(body: JudgeResultBody) {
|
||||
$push.compilerTexts = body.compilerText;
|
||||
}
|
||||
if (body.status) $set.status = body.status;
|
||||
if (body.score) $set.score = body.score;
|
||||
if (body.time) $set.time = body.time;
|
||||
if (body.memory) $set.memory = body.memory;
|
||||
if (body.score !== undefined) $set.score = body.score;
|
||||
if (body.time !== undefined) $set.time = body.time;
|
||||
if (body.memory !== undefined) $set.memory = body.memory;
|
||||
$set.judgeAt = new Date();
|
||||
$set.judger = body.judger;
|
||||
$set.judger = body.judger ?? 1;
|
||||
rdoc = await record.update(body.domainId, body.rid, $set, $push, $unset);
|
||||
await _postJudge(rdoc);
|
||||
bus.boardcast('record/change', rdoc); // trigger a full update
|
||||
|
||||
Reference in new issue
Block a user