MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / get

Method get

packages/hydrooj/src/handler/problem.ts:665–673  ·  view source on GitHub ↗
({ }, d = ['testdata', 'additional_file'], sidebar = false)

Source from the content-addressed store, hash-verified

663 @param('d', Types.CommaSeperatedArray, true)
664 @param('sidebar', Types.Boolean)
665 async get({ }, d = ['testdata', 'additional_file'], sidebar = false) {
666 if (this.tdoc) throw new ContestNotEndedError();
667 this.response.body.testdata = sortFiles(this.pdoc.data || []);
668 this.response.body.additional_file = sortFiles(this.pdoc.additional_file || []);
669 this.response.body.reference = this.pdoc.reference;
670 this.response.pjax = d.map((i) => ['partials/problem_files.html', { filetype: i, sidebar, can_edit: true }]);
671 if (!sidebar) this.response.pjax.push(['partials/problem-sidebar-information.html', {}]);
672 this.response.template = 'problem_files.html';
673 }
674
675 async post() {
676 if (this.args.operation === 'get_links') return;

Callers

nothing calls this directly

Calls 2

sortFilesFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected