judge&ui: fix bugs

This commit is contained in:
panda committed 2022-06-28 16:17:05 +08:00
1 parent 061698a548
commit d7f72617c8
2 files changed
+5 -4

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@ export async function judge({
: '';
let answers: { [x: string]: string | string[] } = {};
try {
answers = yaml.load(answer) as { [x: string]: string | string[] };
answers = yaml.load(answer) as any;
assert(typeof answers === 'object');
} catch (e) {
return end({
@@ -39,7 +39,7 @@ export async function judge({
memory: 0,
};
if (typeof ansInfo[0] === 'string') {
if (ansInfo[0].trim() === (answers[key] as string).trim()) {
if (ansInfo[0].trim() === (answers[key] as any).trim()) {
totalScore += score;
totalStatus = Math.max(totalStatus, STATUS.STATUS_ACCEPTED);
next({