Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
slhmy committed Jun 15, 2024
1 parent af9f017 commit 51e5c19
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
15 changes: 6 additions & 9 deletions src/components/judge/JudgeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,22 @@ const JudgeTable: React.FC<JudgeTableProps> = (props) => {
}}
key={idx}
>
<th>{judge.problem.title}</th>
<td>{judge.user.name}</td>
<th>{judge.problem?.title}</th>
<td>{judge.user?.name}</td>
<td>{judge.language}</td>
<td>
<div
className={joinClasses(
"badge border-0 font-semibold",
judge.status === "finished" &&
judge.mainResult === "Accepted"
judge.status === "finished" && judge.verdict === "Accepted"
? "bg-success/10 text-success"
: "",
judge.status === "finished" &&
judge.mainResult === "WrongAnswer"
judge.verdict === "WrongAnswer"
? "bg-error/10 text-error"
: "",
judge.status === "finished" &&
judge.mainResult === "CompileError"
judge.verdict === "CompileError"
? "bg-warning/10 text-warning"
: "",
judge.status === "pending"
Expand All @@ -68,9 +67,7 @@ const JudgeTable: React.FC<JudgeTableProps> = (props) => {
: "",
)}
>
{judge.status === "finished"
? judge.mainResult
: judge.status}
{judge.status === "finished" ? judge.verdict : judge.status}
</div>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const Drawer: React.FC<DrawerProps> = (props) => {
aria-label="close sidebar"
className="drawer-overlay"
/>
<div className="h-full border-r border-base-content/10">
<div className="h-full border-r border-base-content/10 bg-base-100">
<div className="flex flex-row px-6 py-2">
<img
className="mr-2 h-12 w-auto gap-4"
Expand Down
6 changes: 3 additions & 3 deletions src/mocks/rest/judge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const judges: JudgeServiceModel.JudgeInfo[] = [
language: "Cpp",
code: "#include<bits/stdc++.h>\nusing namespace std;\nint main()\n{}\n",
status: "finished",
mainResult: "Accepted",
verdict: "Accepted",
},
{
UID: "2",
Expand All @@ -61,7 +61,7 @@ const judges: JudgeServiceModel.JudgeInfo[] = [
language: "Cpp",
code: "#include<bits/stdc++.h>\nusing namespace std;\nint main()\n{}\n",
status: "finished",
mainResult: "WrongAnswer",
verdict: "WrongAnswer",
},
{
UID: "3",
Expand All @@ -77,7 +77,7 @@ const judges: JudgeServiceModel.JudgeInfo[] = [
language: "Cpp",
code: "#include<bits/stdc++.h>\nusing namespace std;\nint main()\n{}\n",
status: "finished",
mainResult: "CompileError",
verdict: "CompileError",
},
];

Expand Down
2 changes: 1 addition & 1 deletion src/typings/judge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export namespace JudgeServiceModel {
language: string;
code: string;
status: string;
mainResult: string;
verdict: string;
}
export interface RunJudgeRequest {
code: string;
Expand Down

0 comments on commit 51e5c19

Please sign in to comment.