core: problemStat: 支持重算分段人数

This commit is contained in:
undefined committed 2021-06-13 11:49:35 +08:00
1 parent 6e06a27f2f
commit 382dd53c0c
3 files changed
+12 -16

No files matched your search

@@ -126,12 +126,6 @@ export const judge = async (ctx) => {
await Promise.all(tasks); await Promise.all(tasks);
ctx.stat.done = new Date(); ctx.stat.done = new Date();
if (process.env.DEV) ctx.next({ message: JSON.stringify(ctx.stat) }); if (process.env.DEV) ctx.next({ message: JSON.stringify(ctx.stat) });
console.log({
status: ctx.total_status,
score: ctx.total_score,
time_ms: ctx.total_time_usage_ms,
memory_kb: ctx.total_memory_usage_kb,
});
ctx.end({ ctx.end({
status: ctx.total_status, status: ctx.total_status,
score: ctx.total_score, score: ctx.total_score,
+11 -9
View File
@@ -111,16 +111,18 @@ export async function pdoc(report) {
const $set = { const $set = {
nSubmit: adoc.nSubmit, nSubmit: adoc.nSubmit,
nAccept: adoc.nAccept, nAccept: adoc.nAccept,
'stats.AC': adoc.AC, stats: {
'stats.WA': adoc.WA, AC: adoc.AC,
'stats.TLE': adoc.TLE, WA: adoc.WA,
'stats.MLE': adoc.MLE, TLE: adoc.TLE,
'stats.RE': adoc.RE, MLE: adoc.MLE,
'stats.SE': adoc.SE, RE: adoc.RE,
'stats.IGN': adoc.IGN, SE: adoc.SE,
'stats.CE': adoc.CE, IGN: adoc.IGN,
CE: adoc.CE,
},
}; };
for (let i = 0; i <= 100; i++) if (adoc[`s${i}`]) $set[`stats.s${i}`] = adoc[`s${i}`]; for (let i = 0; i <= 100; i++) if (adoc[`s${i}`]) $set.stats[`s${i}`] = adoc[`s${i}`];
bulk.find({ bulk.find({
domainId: adoc._id.domainId, domainId: adoc._id.domainId,
docType: document.TYPE_PROBLEM, docType: document.TYPE_PROBLEM,
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@hydrooj/ui-default", "name": "@hydrooj/ui-default",
"version": "4.11.18", "version": "4.11.19",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"main": "hydro.js", "main": "hydro.js",