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

Method renderHomework

packages/ui-default/index.ts:111–118  ·  view source on GitHub ↗
(domainId, payload)

Source from the content-addressed store, hash-verified

109 }
110
111 async renderHomework(domainId, payload) {
112 const cur = payload.domainId ? await UserModel.getById(payload.domainId, this.user._id) : this.user;
113 const tdoc = cur.hasPerm(PERM.PERM_VIEW | PERM.PERM_VIEW_HOMEWORK)
114 ? await ContestModel.get(payload.domainId || domainId, new ObjectId(payload.id))
115 : null;
116 if (tdoc) return await this.renderHTML('partials/homework.html', { tdoc });
117 return '';
118 }
119
120 async post({ domainId, items }) {
121 const res: any[] = [];

Callers 1

postMethod · 0.95

Calls 4

getByIdMethod · 0.80
hasPermMethod · 0.80
renderHTMLMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected