core: fix submission calculation

This commit is contained in:
undefined committed 2022-02-04 18:16:19 +08:00
1 parent 34c75c94fd
commit aa3721fdc1
2 files changed
+2 -5

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.4.3",
"version": "3.4.4",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+1 -4
View File
@@ -436,10 +436,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
const rdoc = await record.get(domainId, rid);
if (!pretest) {
await Promise.all([
(this.tdoc
? (this.tsdoc.journal || []).filter((i) => i.pid === this.pdoc.docId).length
: this.psdoc?.rid ? Promise.resolve() : problem.inc(domainId, this.pdoc.docId, 'nSubmit', 1)
) && problem.inc(this.domainId, this.pdoc.docId, 'nSubmit', 1),
problem.inc(this.domainId, this.pdoc.docId, 'nSubmit', 1),
problem.incStatus(domainId, this.pdoc.docId, this.user._id, 'nSubmit', 1),
domain.incUserInDomain(domainId, this.user._id, 'nSubmit'),
tid && contest.updateStatus(domainId, tid, this.user._id, rid, this.pdoc.docId),