|
|
@ -58,6 +58,9 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma |
|
|
} |
|
|
} |
|
|
int watermark = getWatermark(task); |
|
|
int watermark = getWatermark(task); |
|
|
int targetLine = getTargetLine(task); |
|
|
int targetLine = getTargetLine(task); |
|
|
|
|
|
if (watermark >= targetLine) { |
|
|
|
|
|
watermark = targetLine - 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Map<String, Double> questionTypeMap = questionTypeProportion(task); |
|
|
Map<String, Double> questionTypeMap = questionTypeProportion(task); |
|
|
|
|
|
|
|
|
@ -108,6 +111,10 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma |
|
|
|
|
|
|
|
|
Map<String, Double> questionTypeMap = questionTypeProportion(task); |
|
|
Map<String, Double> questionTypeMap = questionTypeProportion(task); |
|
|
int waterLine = getWatermark(task); |
|
|
int waterLine = getWatermark(task); |
|
|
|
|
|
int targetLine = getTargetLine(task); |
|
|
|
|
|
if (waterLine >= targetLine) { |
|
|
|
|
|
waterLine = targetLine - 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
StringBuilder resultBuilder = new StringBuilder(); |
|
|
StringBuilder resultBuilder = new StringBuilder(); |
|
|
resultBuilder.append("=== 库存检查报告 ===\n"); |
|
|
resultBuilder.append("=== 库存检查报告 ===\n"); |
|
|
@ -154,6 +161,8 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma |
|
|
resultBuilder.append(" 知识点总数: ").append(kpCount).append("\n"); |
|
|
resultBuilder.append(" 知识点总数: ").append(kpCount).append("\n"); |
|
|
resultBuilder.append(" 达标知识点数: ").append(passedCount).append("\n"); |
|
|
resultBuilder.append(" 达标知识点数: ").append(passedCount).append("\n"); |
|
|
resultBuilder.append(" 是否全部达标: ").append(passedCount == kpCount ? "是" : "否").append("\n"); |
|
|
resultBuilder.append(" 是否全部达标: ").append(passedCount == kpCount ? "是" : "否").append("\n"); |
|
|
|
|
|
int targetPerKp = (int) Math.ceil(targetLine * questionTypeMap.get(questionType.name())); |
|
|
|
|
|
resultBuilder.append(" 应生成题目总数: ").append(kpCount * targetPerKp).append("\n"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 多知识点簇检查
|
|
|
// 多知识点簇检查
|
|
|
@ -202,6 +211,8 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma |
|
|
resultBuilder.append(" 簇总数: ").append(total).append("\n"); |
|
|
resultBuilder.append(" 簇总数: ").append(total).append("\n"); |
|
|
resultBuilder.append(" 达标簇数: ").append(passed).append("\n"); |
|
|
resultBuilder.append(" 达标簇数: ").append(passed).append("\n"); |
|
|
resultBuilder.append(" 是否全部达标: ").append(passed == total ? "是" : "否").append("\n"); |
|
|
resultBuilder.append(" 是否全部达标: ").append(passed == total ? "是" : "否").append("\n"); |
|
|
|
|
|
int targetPerCluster = (int) Math.ceil(targetLine * size * questionTypeMap.get(QuestionTypeEnum.MULTIPLE_CHOICE.name())); |
|
|
|
|
|
resultBuilder.append(" 应生成题目总数: ").append(total * targetPerCluster).append("\n"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -261,17 +272,37 @@ public class QuestionInventoryDomainServiceImpl implements QuestionInventoryDoma |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 计算水位线 (watermark = ceil(1.0 * u)) |
|
|
* 计算水位线 (watermark = ceil(1.0 * u * 题目总数/知识点数)) |
|
|
*/ |
|
|
*/ |
|
|
private int getWatermark(TaskEntity task) { |
|
|
private int getWatermark(TaskEntity task) { |
|
|
return (int) Math.ceil(1.0 * getUnpassedCount(task)); |
|
|
double multiplier = getQuestionCountMultiplier(task); |
|
|
|
|
|
return (int) Math.ceil(1.0 * getUnpassedCount(task) * multiplier); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 计算目标线 (targetLine = ceil(2 * u)) |
|
|
* 计算目标线 (targetLine = ceil(2 * u * 题目总数/知识点数)) |
|
|
*/ |
|
|
*/ |
|
|
private int getTargetLine(TaskEntity task) { |
|
|
private int getTargetLine(TaskEntity task) { |
|
|
return (int) Math.ceil(2 * getUnpassedCount(task)); |
|
|
double multiplier = getQuestionCountMultiplier(task); |
|
|
|
|
|
return (int) Math.ceil(2 * getUnpassedCount(task) * multiplier); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 题目数量系数 = 题目总数 / 知识点数 |
|
|
|
|
|
* 题目总数 = 单选 + 多选 + 判断(不含简答) |
|
|
|
|
|
* 知识点数 = 任务下的任务知识点记录数 |
|
|
|
|
|
*/ |
|
|
|
|
|
private double getQuestionCountMultiplier(TaskEntity task) { |
|
|
|
|
|
int totalNum = (task.getSingleChoiceNum() == null ? 0 : task.getSingleChoiceNum()) |
|
|
|
|
|
+ (task.getMultipleChoiceNum() == null ? 0 : task.getMultipleChoiceNum()) |
|
|
|
|
|
+ (task.getTrueFalseNum() == null ? 0 : task.getTrueFalseNum()); |
|
|
|
|
|
Long kpCount = taskKpMapper.selectCount( |
|
|
|
|
|
new LambdaQueryWrapper<TaskKnowledgePointEntity>() |
|
|
|
|
|
.eq(TaskKnowledgePointEntity::getTaskId, task.getId())); |
|
|
|
|
|
if (totalNum <= 0 || kpCount == null || kpCount <= 0) { |
|
|
|
|
|
return 1.0; |
|
|
|
|
|
} |
|
|
|
|
|
return totalNum * 1.0 / kpCount; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
|