mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: 修复作业成绩表计分异常的问题
This commit is contained in:
1 parent
f0b9bee937
commit
f0c1b49ac1
4 files changed
+5
-6
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hydrooj/hydrojudge",
|
||||
"bin": "bin/hydrojudge.js",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"main": "package.json",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -71,7 +71,6 @@ async function postInit() {
|
||||
}
|
||||
|
||||
async function cacheOpen(domainId: string, pid: string, files: any[]) {
|
||||
console.log(files);
|
||||
const filePath = path.join(getConfig('cache_dir'), domainId, pid);
|
||||
await fs.ensureDir(filePath);
|
||||
if (!files.length) throw new SystemError('Problem data not found.');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.17.1",
|
||||
"version": "2.17.2",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -214,7 +214,7 @@ const homework: ContestRule = {
|
||||
stat: (tdoc, journal) => {
|
||||
const effective = {};
|
||||
for (const j of journal) {
|
||||
if (tdoc.pids.includes(j.pid) && !effective[j.pid] && j.accept) {
|
||||
if (tdoc.pids.includes(j.pid) && (!effective[j.pid] || j.accept)) {
|
||||
effective[j.pid] = j;
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ const homework: ContestRule = {
|
||||
}
|
||||
return {
|
||||
score: Math.sum(detail.map((d) => d.score)),
|
||||
penaltyScore: Math.sum(detail.map((d) => d.penaltySince)),
|
||||
penaltyScore: Math.sum(detail.map((d) => d.penaltyScore)),
|
||||
time: Math.sum(detail.map((d) => d.time)),
|
||||
detail,
|
||||
};
|
||||
@@ -300,7 +300,7 @@ const homework: ContestRule = {
|
||||
const rows = [columns];
|
||||
for (const [rank, tsdoc] of rankedTsdocs) {
|
||||
const tsddict = {};
|
||||
for (const item of tsdoc.journal || []) {
|
||||
for (const item of tsdoc.detail || []) {
|
||||
tsddict[item.pid] = item;
|
||||
}
|
||||
const row = [
|
||||
|
||||
Reference in new issue
Block a user