mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix bugs
This commit is contained in:
1 parent
d7f72617c8
commit
4529a501da
1 file changed
+3
-2
@@ -727,7 +727,7 @@ const scripts: UpgradeScript[] = [
|
|||||||
for (const pdoc of pdocs) {
|
for (const pdoc of pdocs) {
|
||||||
try {
|
try {
|
||||||
const config = yaml.load(pdoc.config as string) as any;
|
const config = yaml.load(pdoc.config as string) as any;
|
||||||
if (config.type !== 'objective') continue;
|
if (config.type !== 'objective' || !config.outputs) continue;
|
||||||
config.answers = {};
|
config.answers = {};
|
||||||
let cnt = 0;
|
let cnt = 0;
|
||||||
for (const l of config.outputs) {
|
for (const l of config.outputs) {
|
||||||
@@ -756,7 +756,7 @@ const scripts: UpgradeScript[] = [
|
|||||||
} else text += `{{ input(${scnt}) }}\n`;
|
} else text += `{{ input(${scnt}) }}\n`;
|
||||||
text += '\n';
|
text += '\n';
|
||||||
}
|
}
|
||||||
} catch (e) { console.error(e); }
|
} catch (e) { console.error(e); return content; }
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,6 +772,7 @@ const scripts: UpgradeScript[] = [
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const content = processSingleLanguage(pdoc.content);
|
const content = processSingleLanguage(pdoc.content);
|
||||||
|
delete config.outputs;
|
||||||
await problem.edit(ddoc._id, pdoc.docId, { content });
|
await problem.edit(ddoc._id, pdoc.docId, { content });
|
||||||
}
|
}
|
||||||
uids.add(pdoc.owner);
|
uids.add(pdoc.owner);
|
||||||
|
|||||||
Reference in new issue
Block a user