mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
judge: objective: handle zero-question problem
This commit is contained in:
1 parent
3371f39ef4
commit
700de4fc9d
1 file changed
+2
@@ -2,6 +2,7 @@ import assert from 'assert';
|
||||
import { readFile } from 'fs-extra';
|
||||
import yaml from 'js-yaml';
|
||||
import { STATUS } from '@hydrooj/utils/lib/status';
|
||||
import { FormatError } from '../error';
|
||||
import { Context } from './interface';
|
||||
|
||||
export async function judge({
|
||||
@@ -29,6 +30,7 @@ export async function judge({
|
||||
}
|
||||
let totalScore = 0;
|
||||
let totalStatus = 0;
|
||||
if (!Object.keys(answers).length) throw new FormatError('Invalid standard answer.');
|
||||
for (const key in config.answers) {
|
||||
const [subtaskId, caseId] = key.split('-').map(Number);
|
||||
const ansInfo = config.answers[key] as [string | string[], number];
|
||||
|
||||
Reference in new issue
Block a user