mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: buildContent by default
This commit is contained in:
1 parent
29eff97c1a
commit
0fcbcf4f1a
5 files changed
+27
-4
No files matched your search
@@ -9,6 +9,7 @@ import { BadRequestError, ValidationError } from 'hydrooj/dist/error';
|
||||
import { ProblemAdd } from 'hydrooj/dist/lib/ui';
|
||||
import problem from 'hydrooj/dist/model/problem';
|
||||
import { PERM } from 'hydrooj/dist/model/builtin';
|
||||
import { buildContent } from 'hydrooj/dist/lib/content';
|
||||
import type { ContentNode, ProblemConfig } from 'hydrooj';
|
||||
|
||||
fs.ensureDirSync('/tmp/hydro/import-qduoj');
|
||||
@@ -76,7 +77,7 @@ class ImportQduojHandler extends Handler {
|
||||
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, JSON.stringify(content), this.user._id, pdoc.tags);
|
||||
const pid = await problem.add(domainId, pdoc.display_id, pdoc.title, buildContent(content, 'html'), this.user._id, pdoc.tags);
|
||||
const config: ProblemConfig = {
|
||||
time: `${pdoc.time_limit}ms`,
|
||||
memory: `${pdoc.memory_limit}m`,
|
||||
|
||||
Reference in new issue
Block a user