mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: skip subtask if already unaccepted (#34)
This commit is contained in:
1 parent
1817341eee
commit
9f0668d938
6 files changed
+26
-7
No files matched your search
+2
-2
@@ -21,12 +21,12 @@
|
|||||||
"@shelf/jest-mongodb": "^1.2.3",
|
"@shelf/jest-mongodb": "^1.2.3",
|
||||||
"@types/cross-spawn": "^6.0.2",
|
"@types/cross-spawn": "^6.0.2",
|
||||||
"@types/jest": "^26.0.14",
|
"@types/jest": "^26.0.14",
|
||||||
"@types/node": "^14.14.8",
|
"@types/node": "^14.14.10",
|
||||||
"@types/semver": "^7.3.4",
|
"@types/semver": "^7.3.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^3.9.1",
|
"@typescript-eslint/eslint-plugin": "^3.9.1",
|
||||||
"@typescript-eslint/parser": "^3.9.1",
|
"@typescript-eslint/parser": "^3.9.1",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
"eslint": "^7.13.0",
|
"eslint": "^7.14.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.1",
|
"eslint-config-airbnb-base": "^14.2.1",
|
||||||
"eslint-import-resolver-typescript": "^2.3.0",
|
"eslint-import-resolver-typescript": "^2.3.0",
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.22.1",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "2.1.27",
|
"version": "2.1.28",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"author": "masnn",
|
"author": "masnn",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
"lodash": "^4.17.20",
|
"lodash": "^4.17.20",
|
||||||
"p-queue": "^6.6.1",
|
"p-queue": "^6.6.1",
|
||||||
"shell-quote": "^1.7.2",
|
"shell-quote": "^1.7.2",
|
||||||
"supports-color": "^7.2.0",
|
"supports-color": "^8.0.0",
|
||||||
"systeminformation": "^4.30.1",
|
"systeminformation": "^4.30.6",
|
||||||
"yargs": "^16.1.1"
|
"yargs": "^16.1.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -18,6 +18,21 @@ const Score = {
|
|||||||
|
|
||||||
function judgeCase(c) {
|
function judgeCase(c) {
|
||||||
return async (ctx, ctxSubtask) => {
|
return async (ctx, ctxSubtask) => {
|
||||||
|
if ((ctxSubtask.subtask.type === 'min' && !ctxSubtask.score)
|
||||||
|
|| (ctxSubtask.subtask.type === 'max' && ctxSubtask.score === ctxSubtask.subtask.score)) {
|
||||||
|
ctx.next({
|
||||||
|
status: STATUS.STATUS_JUDGING,
|
||||||
|
case: {
|
||||||
|
status: STATUS.STATUS_CANCELED,
|
||||||
|
score: 0,
|
||||||
|
time_ms: 0,
|
||||||
|
memory_kb: 0,
|
||||||
|
message: '',
|
||||||
|
},
|
||||||
|
progress: Math.floor((c.id * 100) / ctx.config.count),
|
||||||
|
}, c.id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { filename } = ctx.config;
|
const { filename } = ctx.config;
|
||||||
const copyIn = { ...ctx.execute.copyIn };
|
const copyIn = { ...ctx.execute.copyIn };
|
||||||
if (filename) copyIn[`${filename}.in`] = { src: c.input };
|
if (filename) copyIn[`${filename}.in`] = { src: c.input };
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
"serialize-javascript": "^5.0.1",
|
"serialize-javascript": "^5.0.1",
|
||||||
"sockjs": "^0.3.20",
|
"sockjs": "^0.3.20",
|
||||||
"superagent": "^6.1.0",
|
"superagent": "^6.1.0",
|
||||||
"supports-color": "^7.2.0",
|
"supports-color": "^8.0.0",
|
||||||
"systeminformation": "^4.30.1",
|
"systeminformation": "^4.30.6",
|
||||||
"wtfnode": "^0.8.4",
|
"wtfnode": "^0.8.4",
|
||||||
"yargs": "^16.1.1"
|
"yargs": "^16.1.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ String.prototype.translate = function translate(...languages: string[]) {
|
|||||||
if (locales[language]) {
|
if (locales[language]) {
|
||||||
if (locales[language][this] !== undefined) return locales[language][this];
|
if (locales[language][this] !== undefined) return locales[language][this];
|
||||||
}
|
}
|
||||||
|
if (locales[language.split('_')[0]]) {
|
||||||
|
if (locales[language.split('_')[0]][this] !== undefined) return locales[language.split('_')[0]][this];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export async function feedback() {
|
|||||||
addons: global.addons,
|
addons: global.addons,
|
||||||
memory: inf.memory,
|
memory: inf.memory,
|
||||||
osinfo: inf.osinfo,
|
osinfo: inf.osinfo,
|
||||||
|
cpu: inf.cpu,
|
||||||
flags: inf.flags,
|
flags: inf.flags,
|
||||||
}));
|
}));
|
||||||
axios.post('https://feedback.undefined.moe/', { payload });
|
axios.post('https://feedback.undefined.moe/', { payload });
|
||||||
|
|||||||
Reference in new issue
Block a user