mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: objective
This commit is contained in:
1 parent
de5b908272
commit
47b7866053
14 files changed
+31
-18
No files matched your search
@@ -126,7 +126,7 @@ export enum ProblemType {
|
||||
Default = 'default',
|
||||
SubmitAnswer = 'submit_answer',
|
||||
Interactive = 'interactive',
|
||||
Subjective = 'subjective',
|
||||
Objective = 'objective',
|
||||
}
|
||||
|
||||
export enum SubtaskType {
|
||||
|
||||
@@ -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;
|
||||
Reference in new issue
Block a user