mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: judge_config: add fast input case (#413)
Co-authored-by: undefined <i@undefined.moe>
This commit is contained in:
1 parent
b3e975cf38
commit
b7cdadc255
6 files changed
+48
-8
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/vjudge",
|
||||
"version": "1.5.0-next.6",
|
||||
"version": "1.5.0-next.7",
|
||||
"description": "Submit problems to remote oj",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface IBasicProvider {
|
||||
}>;
|
||||
entryProblemLists?: string[];
|
||||
listProblem(page: number, resync: boolean, listId: string): Promise<string[]>;
|
||||
submitProblem(id: string, lang: string, code: string, info: any, next: any, end: any): Promise<string>;
|
||||
submitProblem(id: string, lang: string, code: string, info: any, next: any, end: any): Promise<string | void>;
|
||||
waitForSubmission(id: string, next: any, end: any): Promise<void>;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,8 +89,6 @@ export default class LuoguProvider implements IBasicProvider {
|
||||
}
|
||||
|
||||
async getProblem(id: string) {
|
||||
logger.info(id);
|
||||
// TODO
|
||||
return {
|
||||
title: id,
|
||||
data: {},
|
||||
@@ -104,9 +102,16 @@ export default class LuoguProvider implements IBasicProvider {
|
||||
return [];
|
||||
}
|
||||
|
||||
async submitProblem(id: string, lang: string, code: string, info) {
|
||||
async submitProblem(id: string, lang: string, code: string, info, next, end) {
|
||||
let enableO2 = 0;
|
||||
const comment = setting.langs[lang]?.comment;
|
||||
if (code.length < 10) {
|
||||
end({ status: STATUS.STATUS_COMPILE_ERROR, message: 'Code too short' });
|
||||
return null;
|
||||
}
|
||||
if (!lang.startsWith('luogu.')) {
|
||||
end({ status: STATUS.STATUS_COMPILE_ERROR, message: `Language not supported: ${lang}` });
|
||||
}
|
||||
if (comment) {
|
||||
const msg = `Hydro submission #${info.rid}@${new Date().toLocaleString()}`;
|
||||
if (typeof comment === 'string') code = `${comment} ${msg}\n${code}`;
|
||||
@@ -116,7 +121,7 @@ export default class LuoguProvider implements IBasicProvider {
|
||||
enableO2 = 1;
|
||||
lang = lang.slice(0, -2);
|
||||
}
|
||||
lang = lang.includes('luogu.') ? lang.split('luogu.')[1] : '0';
|
||||
lang = lang.split('luogu.')[1];
|
||||
const result = await this.post(`/fe/api/problem/submit/${id}${this.account.query || ''}`)
|
||||
.set('referer', `https://www.luogu.com.cn/problem/${id}`)
|
||||
.send({
|
||||
|
||||
Reference in new issue
Block a user