mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui&judge: bug fixes and improvements
This commit is contained in:
4 files changed
+4
-2
No files matched your search
@@ -29,8 +29,7 @@ export function parse(output: string, fullscore: number) {
|
|||||||
if (p === 1) {
|
if (p === 1) {
|
||||||
status = STATUS.STATUS_ACCEPTED;
|
status = STATUS.STATUS_ACCEPTED;
|
||||||
score = fullscore;
|
score = fullscore;
|
||||||
const base = output.replace('points ', '') || '';
|
message = output.replace(/^points [\d.]+ /, '') || '';
|
||||||
message = base.substring(base.indexOf(' '), 1024);
|
|
||||||
} else score = Math.floor(fullscore * p);
|
} else score = Math.floor(fullscore * p);
|
||||||
}
|
}
|
||||||
while (operation.test(message)) {
|
while (operation.test(message)) {
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ export class ContestDetailHandler extends Handler {
|
|||||||
@param('tid', Types.ObjectId)
|
@param('tid', Types.ObjectId)
|
||||||
@param('code', Types.String, true)
|
@param('code', Types.String, true)
|
||||||
async postAttend(domainId: string, tid: ObjectId, code = '') {
|
async postAttend(domainId: string, tid: ObjectId, code = '') {
|
||||||
|
this.checkPerm(PERM.PERM_ATTEND_CONTEST);
|
||||||
if (contest.isDone(this.tdoc)) throw new ContestNotLiveError(tid);
|
if (contest.isDone(this.tdoc)) throw new ContestNotLiveError(tid);
|
||||||
if (this.tdoc._code && code !== this.tdoc._code) throw new InvalidTokenError('Contest Invitation', code);
|
if (this.tdoc._code && code !== this.tdoc._code) throw new InvalidTokenError('Contest Invitation', code);
|
||||||
await contest.attend(domainId, tid, this.user._id);
|
await contest.attend(domainId, tid, this.user._id);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export { default as Socket } from './components/socket/index';
|
|||||||
export { default as uploadFiles } from './components/upload';
|
export { default as uploadFiles } from './components/upload';
|
||||||
export * as redux from 'react-redux';
|
export * as redux from 'react-redux';
|
||||||
export * from './components/zipDownloader';
|
export * from './components/zipDownloader';
|
||||||
|
export * from '@hydrooj/utils/lib/common';
|
||||||
export { default as download } from './components/zipDownloader';
|
export { default as download } from './components/zipDownloader';
|
||||||
export { default as $ } from 'jquery';
|
export { default as $ } from 'jquery';
|
||||||
export { default as _ } from 'lodash';
|
export { default as _ } from 'lodash';
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ env.addGlobal('eval', eval);
|
|||||||
env.addGlobal('Date', Date);
|
env.addGlobal('Date', Date);
|
||||||
env.addGlobal('Object', Object);
|
env.addGlobal('Object', Object);
|
||||||
env.addGlobal('String', String);
|
env.addGlobal('String', String);
|
||||||
|
env.addGlobal('Array', Array);
|
||||||
env.addGlobal('Math', Math);
|
env.addGlobal('Math', Math);
|
||||||
env.addGlobal('process', process);
|
env.addGlobal('process', process);
|
||||||
env.addGlobal('global', global);
|
env.addGlobal('global', global);
|
||||||
|
|||||||
Reference in new issue
Block a user