mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 09:36:08 +08:00
core: contest: add fallback value
This commit is contained in:
1 parent
502ced8f27
commit
c2f63c80e1
4 files changed
+9
-8
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "4.2.2",
|
||||
"version": "4.2.3",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/plugin-api",
|
||||
"module": "src/plugin-api",
|
||||
|
||||
@@ -484,6 +484,7 @@ export class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||
@param('tid', Types.ObjectID, true)
|
||||
async prepare(domainId: string, tid?: ObjectID) {
|
||||
if (tid && !contest.isOngoing(this.tdoc, this.tsdoc)) throw new ContestNotLiveError(this.tdoc.docId);
|
||||
if (typeof this.pdoc.config === 'string') throw new BadRequestError('Invalid problem config');
|
||||
}
|
||||
|
||||
async get() {
|
||||
|
||||
@@ -130,9 +130,9 @@ const acm = buildContestRule({
|
||||
];
|
||||
if (isExport) {
|
||||
row.push({ type: 'email', value: udoc.mail });
|
||||
row.push({ type: 'string', value: udoc.school });
|
||||
row.push({ type: 'string', value: udoc.displayName });
|
||||
row.push({ type: 'string', value: udoc.studentId });
|
||||
row.push({ type: 'string', value: udoc.school || '' });
|
||||
row.push({ type: 'string', value: udoc.displayName || '' });
|
||||
row.push({ type: 'string', value: udoc.studentId || '' });
|
||||
}
|
||||
row.push({
|
||||
type: 'time',
|
||||
@@ -260,9 +260,9 @@ const oi = buildContestRule({
|
||||
];
|
||||
if (isExport) {
|
||||
row.push({ type: 'email', value: udoc.mail });
|
||||
row.push({ type: 'string', value: udoc.school });
|
||||
row.push({ type: 'string', value: udoc.displayName });
|
||||
row.push({ type: 'string', value: udoc.studentId });
|
||||
row.push({ type: 'string', value: udoc.school || '' });
|
||||
row.push({ type: 'string', value: udoc.displayName || '' });
|
||||
row.push({ type: 'string', value: udoc.studentId || '' });
|
||||
}
|
||||
row.push({ type: 'total_score', value: tsdoc.score || 0 });
|
||||
for (const pid of tdoc.pids) {
|
||||
|
||||
@@ -164,7 +164,7 @@ DomainSetting(
|
||||
);
|
||||
|
||||
DomainUserSetting(
|
||||
Setting('setting_info', 'displayName', null, 'text', 'Display Name'),
|
||||
Setting('setting_info', 'displayName', '', 'text', 'Display Name'),
|
||||
Setting('setting_storage', 'nAccept', 0, 'number', 'nAccept', null, FLAG_HIDDEN | FLAG_DISABLED),
|
||||
Setting('setting_storage', 'nSubmit', 0, 'number', 'nSubmit', null, FLAG_HIDDEN | FLAG_DISABLED),
|
||||
Setting('setting_storage', 'nLike', 0, 'number', 'nLike', null, FLAG_HIDDEN | FLAG_DISABLED),
|
||||
|
||||
Reference in new issue
Block a user