Skip to content

Commit

Permalink
[Release] 0.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Jan 30, 2022
1 parent c8419f0 commit 5587b80
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to Kawaii Cocoa Grader will be documented here

Changelog before 0.2.2 will not be noted here

## [0.2.9] - 2022-01-30

- It is normal for Idea to come in after I publish a release

## [0.2.8] - 2022-01-30

- Fix Misc Mistake
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cocoa-grader",
"version": "0.2.8",
"version": "0.2.9",
"description": "Discord Bot Grader",
"main": "dist/bot/client.js",
"repository": "https://github.com/Leomotors/cocoa-grader",
Expand Down
35 changes: 18 additions & 17 deletions src/bot/commands/message/submit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import Grade, { Verdict } from "../../../grader/grader";
import { problemExists } from "../../../grader/problems";
import { Cocoa } from "../../shared";

function EmbedGen(msg: Message, result: Verdict, perf: number) {
function EmbedGen(msg: Message, result: Verdict, perf: number, lang: string) {
const pb = result.problem;

return new Embed()
const e = new Embed()
.setAuthor(Author(msg))
.setTitle(pb.title)
.setDescription(
Expand All @@ -26,35 +26,34 @@ function EmbedGen(msg: Message, result: Verdict, perf: number) {
.setThumbnail(Cocoa.GIF.NoPoi)
.addFields(
{
name: "Problem Statement",
value: `${
pb.statement ? `[Click](${pb.statement})` : "Does not exist"
}`,
name: "Submission ID",
value: "#" + result.submissionId.split("-")[0],
inline: true,
},
{
name: "Graded on",
value: `${process.platform} ${process.arch}`,
name: "Language",
value: lang,
inline: true,
},
{
name: "Grader Version",
value: process.env.npm_package_version ?? "Unknown",
name: "Your Score",
value: `${result.score}/${pb.maxScore ?? 100}`,
inline: true,
},

{
name: "Time Compensation",
value: `${process.env.EXTRA_TIME ?? 1}x`,
name: "Graded on",
value: `${process.platform} ${process.arch}`,
inline: true,
},
{
name: "Submission ID",
value: "#" + result.submissionId.split("-")[0],
name: "Grader Version",
value: process.env.npm_package_version ?? "Unknown",
inline: true,
},
{
name: "Your Score",
value: `${result.score}/${pb.maxScore ?? 100}`,
name: "Time Compensation",
value: `${process.env.EXTRA_TIME ?? 1}x`,
inline: true,
},
{
Expand All @@ -74,6 +73,8 @@ function EmbedGen(msg: Message, result: Verdict, perf: number) {
}
)
.setFooter(Cocoa.Footer(msg));

return pb.statement ? e.setURL(pb.statement) : e;
}

// * Accept Submission and Print Result
Expand Down Expand Up @@ -140,7 +141,7 @@ export const submit: CocoaMessage = {

sentmsg.edit({
content: "Graded!",
embeds: [EmbedGen(msg, result, perf).toJSON()],
embeds: [EmbedGen(msg, result, perf, lang).toJSON()],
});
},
};
2 changes: 1 addition & 1 deletion src/bot/commands/slash/getstatement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const getstatement: CocoaSlash = {
},
{
name: "Statement",
value: `[Click](${Problem.statement})`,
value: `[CLICK](${Problem.statement})`,
inline: true,
}
)
Expand Down

0 comments on commit 5587b80

Please sign in to comment.