core&ui: add auto organize input option to hack (#780)

Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
Milmonandundefined authored and GitHub committed 2024-05-14 22:35:34 +08:00
1 parent 42569783f9
commit ffe06804a7
7 files changed
+41 -5

No files matched your search

+3 -1
View File
@@ -24,7 +24,7 @@ export default class RecordModel {
'_id', 'score', 'time', 'memory', 'lang',
'uid', 'pid', 'rejudged', 'progress', 'domainId',
'contest', 'judger', 'judgeAt', 'status', 'source',
'files',
'files', 'hackTarget',
];
static STAT_QUERY = {
@@ -122,6 +122,7 @@ export default class RecordModel {
contest?: ObjectId,
input?: string,
files?: Record<string, string>,
hackTarget?: ObjectId,
type: 'judge' | 'rejudge' | 'pretest' | 'hack' | 'generate',
} = { type: 'judge' },
) {
@@ -146,6 +147,7 @@ export default class RecordModel {
let isContest = !!args.contest;
if (args.contest) data.contest = args.contest;
if (args.files) data.files = args.files;
if (args.hackTarget) data.hackTarget = args.hackTarget;
if (args.type === 'rejudge') {
args.type = 'judge';
data.rejudged = true;