Skip to content

Commit b5d918e

Browse files
VisenPAntony1060
andauthored
Prod sync (#116)
* Use edu user name on leaderboard if present (#114) * Use edu user name on leaderboard if present * Apply name change only on edu contests * Add support for ocaml (#115) * Add support for ocaml * Update apps/backend/src/utils/evaluation.schema.ts Co-authored-by: Antonio F. T. <antoniostignjedec@gmail.com> * Update apps/frontend/src/pages/problems/ProblemViewPage.tsx Co-authored-by: Antonio F. T. <antoniostignjedec@gmail.com> * Update apps/frontend/src/pages/submissions/SubmissionViewPage.tsx Co-authored-by: Antonio F. T. <antoniostignjedec@gmail.com> * Update packages/models/src/Evaluation.ts Co-authored-by: Antonio F. T. <antoniostignjedec@gmail.com> * Update apps/function/src/runners/GenericRunner.ts Co-authored-by: Antonio F. T. <antoniostignjedec@gmail.com> --------- Co-authored-by: Antonio F. T. <antoniostignjedec@gmail.com> --------- Co-authored-by: Antonio F. T. <antoniostignjedec@gmail.com>
1 parent d2bc29f commit b5d918e

6 files changed

Lines changed: 17 additions & 2 deletions

File tree

apps/backend/src/routes/contest/ContestHandler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,12 @@ ContestHandler.get("/:contest_id/leaderboard", async (req, res) => {
490490
eduUser = eduUsers.find((user) => user.id === it.user_id)
491491
) => ({
492492
...it,
493-
...R.pick(user, ["full_name"]),
494493
...R.pick(
495494
organisationMembers.find((member) => member.user_id === it.user_id)!,
496495
["elo"]
497496
),
497+
full_name:
498+
(contest.require_edu_verification && eduUser?.full_name) || user.full_name,
498499
email_domain: user.email.split("@").at(-1),
499500
edu_mail_domain: eduUser?.email.split("@").at(-1),
500501
})

apps/backend/src/utils/evaluation.schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ export const EvaluationLanguageSchema = Type.Union([
88
Type.Literal("go"),
99
Type.Literal("rust"),
1010
Type.Literal("gnu_asm_x86_linux"),
11+
Type.Literal("ocaml"),
1112
Type.Literal("output-only"),
1213
]);

apps/frontend/src/pages/problems/ProblemViewPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export const ProblemViewPage: FC = () => {
181181
<option value="go">Go</option>
182182
<option value="rust">Rust</option>
183183
<option value="java">Java</option>
184+
<option value="ocaml">OCaml</option>
184185
<option value="gnu_asm_x86_linux">
185186
GNU Assembly (Linux x86_64)
186187
</option>

apps/frontend/vite.config.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,16 @@ export default defineConfig({
1313
[
1414
"prismjs",
1515
{
16-
languages: ["python", "c", "cpp", "go", "rust", "java", "nasm"],
16+
languages: [
17+
"python",
18+
"c",
19+
"cpp",
20+
"go",
21+
"rust",
22+
"java",
23+
"nasm",
24+
"ocaml",
25+
],
1726
plugins: ["line-numbers", "match-braces"],
1827
css: true,
1928
},

apps/function/src/runners/GenericRunner.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ const getCompilationProcessForLanguage = (
5858
};
5959
case "gnu_asm_x86_linux":
6060
throw new Error("GNU Assembly is not supported");
61+
case "ocaml":
62+
throw new Error("OCaml is not supported");
6163
}
6264
};
6365

packages/models/src/Evaluation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export type EvaluationLanguage =
66
| "go"
77
| "rust"
88
| "gnu_asm_x86_linux"
9+
| "ocaml"
910
| "output-only";
1011

1112
export type EvaluationVariant = "plain" | "checker" | "interactive" | "output-only";

0 commit comments

Comments
 (0)