bug fixes & improvements for on site contest

This commit is contained in:
undefined committed 2025-11-18 17:59:59 +08:00
1 parent effc7da312
commit 191353fbbc
19 files changed
+383 -68

No files matched your search

+4 -1
View File
@@ -519,7 +519,10 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
await storage.put(`submission/${this.user._id}/${id}`, file.filepath, this.user._id);
files.code = `${this.user._id}/${id}#${file.originalFilename}`;
}
} else if (code.length > lengthLimit) throw new ValidationError('code');
} else {
code = code.replace(/\r\n/g, '\n');
if (code.length > lengthLimit) throw new ValidationError('code');
}
const rid = await record.add(
domainId, this.pdoc.docId, this.user._id, lang, code, true,
pretest ? { input, type: 'pretest' } : { contest: tid, files, type: 'judge' },