You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
451 B

// TODO 判断文件是否存在
function judge(outputFile) {
try {
let jsonResult = JSON.parse(outputFile);
let points = {};
jsonResult.exercises.forEach(({ name, result }) => {
if (result) {
points[name] = [1,1]
} else {
points[name] = [0,1]
}
})
return points;
} catch(e) {
return {};
}
}
module.exports.judge = judge;