core&ui: hello subjective

This commit is contained in:
undefined committed 2021-06-02 11:56:43 +08:00
1 parent 385b8f4fe6
commit 4c7e51631b
8 files changed
+32 -13

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 = 'subjective';
config.type = cfg.type || 'subjective';
} else if (cfg.cases?.length) {
config.subtasks = [{
score: +cfg.score || Math.floor(100 / cfg.cases.length),
@@ -70,7 +70,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 === 'submit_answer' && !cfg.outputs?.length) throw new Error('outputs config not found');
if ((config.type === 'subjective' || cfg.type === 'submit_answer') && !cfg.outputs?.length) throw new Error('outputs config not found');
return Object.assign(cfg, config);
}