diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-12 01:54:36 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-12 01:54:36 +0900 |
| commit | ab6abc3a7619be89dda1bc3ab0b3f19ff69b575f (patch) | |
| tree | 57f4b6da4682ec43cbd7ba2a51c5866f226b0035 /frontend/app/models/SubmitResult.ts | |
| parent | b97b245861b93a5ab5f8bde095d9920fabd0cbbd (diff) | |
| download | iosdc-japan-2024-albatross-ab6abc3a7619be89dda1bc3ab0b3f19ff69b575f.tar.gz iosdc-japan-2024-albatross-ab6abc3a7619be89dda1bc3ab0b3f19ff69b575f.tar.zst iosdc-japan-2024-albatross-ab6abc3a7619be89dda1bc3ab0b3f19ff69b575f.zip | |
refactor(frontend): rename SubmissionResult and VerificationResult for consistant naming
Diffstat (limited to 'frontend/app/models/SubmitResult.ts')
| -rw-r--r-- | frontend/app/models/SubmitResult.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/frontend/app/models/SubmitResult.ts b/frontend/app/models/SubmitResult.ts new file mode 100644 index 0000000..403a0db --- /dev/null +++ b/frontend/app/models/SubmitResult.ts @@ -0,0 +1,36 @@ +import type { ExecResult } from "./ExecResult"; + +export type SubmitResultStatus = + | "running" + | "success" + | "wrong_answer" + | "timeout" + | "compile_error" + | "runtime_error" + | "internal_error"; + +export type SubmitResult = { + status: SubmitResultStatus; + execResults: ExecResult[]; +}; + +export function submitResultStatusToLabel(status: SubmitResultStatus | null) { + switch (status) { + case null: + return "-"; + case "running": + return "Running..."; + case "success": + return "Accepted"; + case "wrong_answer": + return "Wrong Answer"; + case "timeout": + return "Time Limit Exceeded"; + case "compile_error": + return "Compile Error"; + case "runtime_error": + return "Runtime Error"; + case "internal_error": + return "Internal Error"; + } +} |
