core: objective

This commit is contained in:
undefined committed 2021-07-29 00:26:32 +08:00
1 parent de5b908272
commit 47b7866053
14 files changed
+31 -18

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.29.45",
"version": "2.29.46",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+1 -1
View File
@@ -126,7 +126,7 @@ export enum ProblemType {
Default = 'default',
SubmitAnswer = 'submit_answer',
Interactive = 'interactive',
Subjective = 'subjective',
Objective = 'objective',
}
export enum SubtaskType {
+13
View File
@@ -414,6 +414,19 @@ const scripts: UpgradeScript[] = [
}
return true;
},
async function _37_38() {
const _FRESH_INSTALL_IGNORE = 1;
await iterateAllProblem(['docId', 'domainId', 'config'], async (pdoc) => {
logger.info('%s/%s', pdoc.domainId, pdoc.docId);
if (typeof pdoc.config !== 'string') return;
if (!pdoc.config?.includes('type: subjective')) return;
await problem.addTestdata(
pdoc.domainId, pdoc.docId, 'config.yaml',
Buffer.from(pdoc.config.replace('type: subjective', 'type: objective')),
);
});
return true;
},
];
export default scripts;