mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: move permission constants to common
This commit is contained in:
5 files changed
+237
-267
No files matched your search
@@ -1,83 +1,52 @@
|
||||
// Please note that accepted < others, rp system uses this feature.
|
||||
export const STATUS_WAITING = 0;
|
||||
export const STATUS_ACCEPTED = 1;
|
||||
export const STATUS_WRONG_ANSWER = 2;
|
||||
export const STATUS_TIME_LIMIT_EXCEEDED = 3;
|
||||
export const STATUS_MEMORY_LIMIT_EXCEEDED = 4;
|
||||
export const STATUS_OUTPUT_LIMIT_EXCEEDED = 5;
|
||||
export const STATUS_RUNTIME_ERROR = 6;
|
||||
export const STATUS_COMPILE_ERROR = 7;
|
||||
export const STATUS_SYSTEM_ERROR = 8;
|
||||
export const STATUS_CANCELED = 9;
|
||||
export const STATUS_ETC = 10;
|
||||
export const STATUS_JUDGING = 20;
|
||||
export const STATUS_COMPILING = 21;
|
||||
export const STATUS_FETCHED = 22;
|
||||
export const STATUS_IGNORED = 30;
|
||||
|
||||
export const STATUS_TEXTS = {
|
||||
[STATUS_WAITING]: 'Waiting',
|
||||
[STATUS_ACCEPTED]: 'Accepted',
|
||||
[STATUS_WRONG_ANSWER]: 'Wrong Answer',
|
||||
[STATUS_TIME_LIMIT_EXCEEDED]: 'Time Exceeded',
|
||||
[STATUS_MEMORY_LIMIT_EXCEEDED]: 'Memory Exceeded',
|
||||
[STATUS_OUTPUT_LIMIT_EXCEEDED]: 'Output Exceeded',
|
||||
[STATUS_RUNTIME_ERROR]: 'Runtime Error',
|
||||
[STATUS_COMPILE_ERROR]: 'Compile Error',
|
||||
[STATUS_SYSTEM_ERROR]: 'System Error',
|
||||
[STATUS_CANCELED]: 'Cancelled',
|
||||
[STATUS_ETC]: 'Unknown Error',
|
||||
[STATUS_JUDGING]: 'Running',
|
||||
[STATUS_COMPILING]: 'Compiling',
|
||||
[STATUS_FETCHED]: 'Fetched',
|
||||
[STATUS_IGNORED]: 'Ignored',
|
||||
};
|
||||
import { STATUS } from '@hydrooj/common';
|
||||
export { STATUS, STATUS_TEXTS } from '@hydrooj/common';
|
||||
|
||||
export const STATUS_CODES = {
|
||||
[STATUS_WAITING]: 'pending',
|
||||
[STATUS_ACCEPTED]: 'pass',
|
||||
[STATUS_WRONG_ANSWER]: 'fail',
|
||||
[STATUS_TIME_LIMIT_EXCEEDED]: 'fail',
|
||||
[STATUS_MEMORY_LIMIT_EXCEEDED]: 'fail',
|
||||
[STATUS_OUTPUT_LIMIT_EXCEEDED]: 'fail',
|
||||
[STATUS_RUNTIME_ERROR]: 'fail',
|
||||
[STATUS_COMPILE_ERROR]: 'fail',
|
||||
[STATUS_SYSTEM_ERROR]: 'fail',
|
||||
[STATUS_CANCELED]: 'ignored',
|
||||
[STATUS_ETC]: 'fail',
|
||||
[STATUS_JUDGING]: 'progress',
|
||||
[STATUS_COMPILING]: 'progress',
|
||||
[STATUS_FETCHED]: 'progress',
|
||||
[STATUS_IGNORED]: 'ignored',
|
||||
[STATUS.STATUS_WAITING]: 'pending',
|
||||
[STATUS.STATUS_ACCEPTED]: 'pass',
|
||||
[STATUS.STATUS_WRONG_ANSWER]: 'fail',
|
||||
[STATUS.STATUS_TIME_LIMIT_EXCEEDED]: 'fail',
|
||||
[STATUS.STATUS_MEMORY_LIMIT_EXCEEDED]: 'fail',
|
||||
[STATUS.STATUS_OUTPUT_LIMIT_EXCEEDED]: 'fail',
|
||||
[STATUS.STATUS_RUNTIME_ERROR]: 'fail',
|
||||
[STATUS.STATUS_COMPILE_ERROR]: 'fail',
|
||||
[STATUS.STATUS_SYSTEM_ERROR]: 'fail',
|
||||
[STATUS.STATUS_CANCELED]: 'ignored',
|
||||
[STATUS.STATUS_ETC]: 'fail',
|
||||
[STATUS.STATUS_JUDGING]: 'progress',
|
||||
[STATUS.STATUS_COMPILING]: 'progress',
|
||||
[STATUS.STATTUS_FETCHED]: 'progress',
|
||||
[STATUS.STATUS_IGNORED]: 'ignored',
|
||||
};
|
||||
|
||||
/**
|
||||
* Whether to show detail about each test case for a submission status
|
||||
*/
|
||||
export const STATUS_SCRATCHPAD_SHOW_DETAIL_FLAGS = {
|
||||
[STATUS_WAITING]: false,
|
||||
[STATUS_ACCEPTED]: true,
|
||||
[STATUS_WRONG_ANSWER]: true,
|
||||
[STATUS_TIME_LIMIT_EXCEEDED]: true,
|
||||
[STATUS_MEMORY_LIMIT_EXCEEDED]: true,
|
||||
[STATUS_RUNTIME_ERROR]: true,
|
||||
[STATUS_COMPILE_ERROR]: false,
|
||||
[STATUS_SYSTEM_ERROR]: false,
|
||||
[STATUS_CANCELED]: false,
|
||||
[STATUS_ETC]: false,
|
||||
[STATUS_JUDGING]: false,
|
||||
[STATUS_COMPILING]: false,
|
||||
[STATUS_FETCHED]: false,
|
||||
[STATUS_IGNORED]: false,
|
||||
[STATUS.STATUS_WAITING]: false,
|
||||
[STATUS.STATUS_ACCEPTED]: true,
|
||||
[STATUS.STATUS_WRONG_ANSWER]: true,
|
||||
[STATUS.STATUS_TIME_LIMIT_EXCEEDED]: true,
|
||||
[STATUS.STATUS_MEMORY_LIMIT_EXCEEDED]: true,
|
||||
[STATUS.STATUS_RUNTIME_ERROR]: true,
|
||||
[STATUS.STATUS_COMPILE_ERROR]: false,
|
||||
[STATUS.STATUS_SYSTEM_ERROR]: false,
|
||||
[STATUS.STATUS_CANCELED]: false,
|
||||
[STATUS.STATUS_ETC]: false,
|
||||
[STATUS.STATUS_JUDGING]: false,
|
||||
[STATUS.STATUS_COMPILING]: false,
|
||||
[STATUS.STATUS_FETCHED]: false,
|
||||
[STATUS.STATUS_IGNORED]: false,
|
||||
};
|
||||
|
||||
/**
|
||||
* Short text to show in Scratchpad mode
|
||||
*/
|
||||
export const STATUS_SCRATCHPAD_SHORT_TEXTS = {
|
||||
[STATUS_ACCEPTED]: 'AC',
|
||||
[STATUS_WRONG_ANSWER]: 'WA',
|
||||
[STATUS_TIME_LIMIT_EXCEEDED]: 'TLE',
|
||||
[STATUS_MEMORY_LIMIT_EXCEEDED]: 'MLE',
|
||||
[STATUS_RUNTIME_ERROR]: 'RTE',
|
||||
[STATUS.STATUS_ACCEPTED]: 'AC',
|
||||
[STATUS.STATUS_WRONG_ANSWER]: 'WA',
|
||||
[STATUS.STATUS_TIME_LIMIT_EXCEEDED]: 'TLE',
|
||||
[STATUS.STATUS_MEMORY_LIMIT_EXCEEDED]: 'MLE',
|
||||
[STATUS.STATUS_RUNTIME_ERROR]: 'RTE',
|
||||
};
|
||||
Reference in new issue
Block a user