(domainId: string, sort = 'time', direction: 1 | -1 = 1, lang?: string, page = 1)
| 968 | @param('lang', Types.String, true) |
| 969 | @param('page', Types.PositiveInt, true) |
| 970 | async get(domainId: string, sort = 'time', direction: 1 | -1 = 1, lang?: string, page = 1) { |
| 971 | if (this.tdoc) throw new ContestNotEndedError(); |
| 972 | const [rsdocs, pcount, rscount] = await this.paginate( |
| 973 | record.getMultiStat(domainId, { |
| 974 | pid: this.pdoc.docId, |
| 975 | ...lang ? { lang } : {}, |
| 976 | }, record.STAT_QUERY[sort][Math.max(direction, 0)]), |
| 977 | page, |
| 978 | 'record', |
| 979 | ); |
| 980 | const [udict, udoc] = await Promise.all([ |
| 981 | user.getListForRender(domainId, rsdocs.map((i) => i.uid), this.user.hasPerm(PERM.PERM_VIEW_USER_PRIVATE_INFO)), |
| 982 | user.getById(domainId, this.pdoc.owner), |
| 983 | ]); |
| 984 | this.response.template = 'problem_statistics.html'; |
| 985 | this.response.body = { |
| 986 | rsdocs, page, pcount, rscount, sort, direction, pdoc: this.pdoc, udict, types: Object.keys(record.STAT_QUERY), udoc, |
| 987 | }; |
| 988 | } |
| 989 | } |
| 990 | |
| 991 | export class ProblemCreateHandler extends Handler { |
nothing calls this directly
no test coverage detected