mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +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) {
|
||||
status = STATUS.STATUS_ACCEPTED;
|
||||
score = fullscore;
|
||||
const base = output.replace('points ', '') || '';
|
||||
message = base.substring(base.indexOf(' '), 1024);
|
||||
message = output.replace(/^points [\d.]+ /, '') || '';
|
||||
} else score = Math.floor(fullscore * p);
|
||||
}
|
||||
while (operation.test(message)) {
|
||||
|
||||
@@ -245,6 +245,7 @@ export class ContestDetailHandler extends Handler {
|
||||
@param('tid', Types.ObjectId)
|
||||
@param('code', Types.String, true)
|
||||
async postAttend(domainId: string, tid: ObjectId, code = '') {
|
||||
this.checkPerm(PERM.PERM_ATTEND_CONTEST);
|
||||
if (contest.isDone(this.tdoc)) throw new ContestNotLiveError(tid);
|
||||
if (this.tdoc._code && code !== this.tdoc._code) throw new InvalidTokenError('Contest Invitation', code);
|
||||
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 * as redux from 'react-redux';
|
||||
export * from './components/zipDownloader';
|
||||
export * from '@hydrooj/utils/lib/common';
|
||||
export { default as download } from './components/zipDownloader';
|
||||
export { default as $ } from 'jquery';
|
||||
export { default as _ } from 'lodash';
|
||||
|
||||
@@ -137,6 +137,7 @@ env.addGlobal('eval', eval);
|
||||
env.addGlobal('Date', Date);
|
||||
env.addGlobal('Object', Object);
|
||||
env.addGlobal('String', String);
|
||||
env.addGlobal('Array', Array);
|
||||
env.addGlobal('Math', Math);
|
||||
env.addGlobal('process', process);
|
||||
env.addGlobal('global', global);
|
||||
|
||||
Reference in new issue
Block a user