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

+2 -2
View File
@@ -31,7 +31,7 @@ export default async function readYamlCases(cfg: Record<string, any> = {}, check
} else throw new Error('Invalid user_extra_files config.');
}
if (cfg.outputs) {
config.type = cfg.type || 'subjective';
config.type = cfg.type || 'objective';
} else if (cfg.cases?.length) {
config.subtasks = [{
score: +cfg.score || Math.floor(100 / cfg.cases.length),
@@ -71,7 +71,7 @@ export default async function readYamlCases(cfg: Record<string, any> = {}, check
}
if (cfg.time) config.time = parseTimeMS(cfg.time);
if (cfg.memory) config.memory = parseMemoryMB(cfg.memory);
if ((config.type === 'subjective' || cfg.type === 'submit_answer') && !cfg.outputs?.length) throw new Error('outputs config not found');
if ((config.type === 'objective' || cfg.type === 'submit_answer') && !cfg.outputs?.length) throw new Error('outputs config not found');
return Object.assign(cfg, config);
}