judge: objective: validation for empty stdans

This commit is contained in:
undefined committed 2023-01-08 21:11:23 +08:00
1 parent 06e0223793
commit 5ecd9d5952
1 file changed
+1 -1
+1 -1
View File
@@ -30,7 +30,7 @@ export async function judge({
}
let totalScore = 0;
let totalStatus = 0;
if (!Object.keys(answers).length) throw new FormatError('Invalid standard answer.');
if (!Object.keys(config.answers).length) throw new FormatError('Invalid standard answer.');
for (const key in config.answers) {
const ansInfo = config.answers[key] as [string | string[], number] | Record<string, number>;
// eslint-disable-next-line @typescript-eslint/no-loop-func