bug fixes

This commit is contained in:
undefined committed 2025-03-17 07:48:40 +08:00
1 parent 3c65c27911
commit 80d2137cbb
6 files changed
+19 -25

No files matched your search

+1 -13
View File
@@ -1,22 +1,11 @@
import path from 'path';
import {
ContestModel, Context, fs, Handler, ObjectId, PERM, Schema, STATUS, Types, UserModel,
ContestModel, Context, fs, ObjectId, PERM, Schema, STATUS, Types, UserModel,
} from 'hydrooj';
const file = fs.readFileSync(path.join(__dirname, 'public/assets/board.html'), 'utf8');
const indexJs = file.match(/index-([A-Za-z0-9_-]+)\.js"/)?.[1];
const indexCss = file.match(/index-([A-Za-z0-9_-]+)\.css"/)?.[1];
class XcpcioHandler extends Handler {
async get() {
this.response.body = {
js: indexJs,
css: indexCss,
};
this.response.template = 'xcpcio_board.html';
}
}
const status = {
[STATUS.STATUS_WRONG_ANSWER]: 'WRONG_ANSWER',
[STATUS.STATUS_ACCEPTED]: 'CORRECT',
@@ -35,7 +24,6 @@ const status = {
};
export async function apply(ctx: Context) {
ctx.Route('board_xcpcio', '/board', XcpcioHandler);
ctx.inject(['scoreboard'], ({ scoreboard }) => {
scoreboard.addView('xcpcio', 'XCPCIO', {
tdoc: 'tdoc',