diff --git a/packages/hydrooj/src/handler/contest.ts b/packages/hydrooj/src/handler/contest.ts index c74fd3d63..cbcfc60b1 100644 --- a/packages/hydrooj/src/handler/contest.ts +++ b/packages/hydrooj/src/handler/contest.ts @@ -280,6 +280,12 @@ export class ContestProblemListHandler extends ContestDetailBaseHandler { await record.getMulti(domainId, { contest: tid, uid: this.user._id }) .sort({ _id: -1 }).toArray(), ]); + if (!this.user.own(this.tdoc) && !this.user.hasPerm(PERM.PERM_EDIT_CONTEST)) { + this.response.body.rdocs = this.response.body.rdocs.map((rdoc) => contest.applyProjection(this.tdoc, rdoc, this.user)); + for (const psdoc of psdocs) { + this.response.body.rdict[psdoc.rid] = contest.applyProjection(this.tdoc, this.response.body.rdict[psdoc.rid], this.user); + } + } this.response.body.canViewRecord = true; } else { for (const i of psdocs) this.response.body.rdict[i.rid] = { _id: i.rid }; diff --git a/packages/ui-default/templates/components/record.html b/packages/ui-default/templates/components/record.html index d8d84417f..ffcf3fd29 100644 --- a/packages/ui-default/templates/components/record.html +++ b/packages/ui-default/templates/components/record.html @@ -6,7 +6,9 @@ href="{{ url('record_detail', rid=rdoc[rid_key], domainId=rdoc.domainId) if allDomain else url('record_detail', rid=rdoc[rid_key]) }}" class="record-status--text {{ model.builtin.STATUS_CODES[rdoc.status] }}" > + {% if typeof(rdoc['score']) == 'number' %} {{ rdoc.score|default(0) }} + {% endif %} {{ model.builtin.STATUS_SHORT_TEXTS[rdoc.status] if short else model.builtin.STATUS_TEXTS[rdoc.status] }} diff --git a/packages/ui-default/templates/record_detail_status.html b/packages/ui-default/templates/record_detail_status.html index 11734f96a..f2ccb4723 100644 --- a/packages/ui-default/templates/record_detail_status.html +++ b/packages/ui-default/templates/record_detail_status.html @@ -2,7 +2,9 @@