修复数据库连接错误,用户组功能待测试

This commit is contained in:
2025-12-21 01:56:54 +08:00
parent 41f7474f2b
commit b5262fc13a
15 changed files with 162 additions and 198 deletions

View File

@@ -417,7 +417,7 @@ export class ExamTaskModel {
let totalScore = questions.reduce((sum, q) => sum + q.score, 0);
while (totalScore < subject.totalScore) {
// 获取所有类型的随机题目
const allTypes = Object.keys(subject.typeRatios).filter(type => subject.typeRatios[type] > 0);
const allTypes = Object.keys(subject.typeRatios).filter(type => subject.typeRatios[type as keyof typeof subject.typeRatios] > 0);
if (allTypes.length === 0) break;
const randomType = allTypes[Math.floor(Math.random() * allTypes.length)];