mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
import-qduoj: 自动处理题号冲突,修复样例处title为空的问题
This commit is contained in:
1 parent
bf81742fb5
commit
86ee028517
2 files changed
+3
-1
No files matched your search
@@ -53,6 +53,7 @@ class ImportQduojHandler extends Handler {
|
||||
if (pdoc.samples?.length) {
|
||||
content.push(...pdoc.samples.map((sample) => ({
|
||||
type: 'Sample',
|
||||
sectionTitle: this.translate('Sample'),
|
||||
payload: [sample.input, sample.output],
|
||||
})));
|
||||
}
|
||||
@@ -72,6 +73,7 @@ class ImportQduojHandler extends Handler {
|
||||
text: pdoc.source.value,
|
||||
});
|
||||
}
|
||||
if (+pdoc.display_id) pdoc.display_id = `P${pdoc.display_id}`;
|
||||
const n = await problem.get(domainId, pdoc.display_id);
|
||||
if (n) pdoc.display_id = null;
|
||||
const pid = await problem.add(domainId, pdoc.display_id, pdoc.title, content, this.user._id, pdoc.tags);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/import-qduoj",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.5",
|
||||
"description": "Import QDUOJ problem export",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
Reference in new issue
Block a user