mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: objective
This commit is contained in:
1 parent
de5b908272
commit
47b7866053
14 files changed
+31
-18
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user