mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: homework: fix penaltyRules validate
This commit is contained in:
3 files changed
+13
-2
No files matched your search
@@ -20,8 +20,15 @@ import {
|
||||
} from '../service/server';
|
||||
import { ContestCodeHandler, ContestFileDownloadHandler, ContestScoreboardHandler } from './contest';
|
||||
|
||||
const validatePenaltyRules = (input: string) => yaml.load(input);
|
||||
const convertPenaltyRules = validatePenaltyRules;
|
||||
const validatePenaltyRules = (input: string) => {
|
||||
try {
|
||||
yaml.load(input);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const convertPenaltyRules = (input: string) => yaml.load(input);
|
||||
|
||||
class HomeworkMainHandler extends Handler {
|
||||
@param('group', Types.Name, true)
|
||||
|
||||
Reference in new issue
Block a user