|
@@ -179,6 +179,12 @@ public class SpecialReportService {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
String contrast = result.getWrongAnswerContrast();
|
|
String contrast = result.getWrongAnswerContrast();
|
|
|
|
+ String correct = result.getCollectQuestion();
|
|
|
|
+ logger.info("correct={}", correct);
|
|
|
|
+ Set<Integer> collects = new HashSet<>();
|
|
|
|
+ if (StringUtils.isNotBlank(correct)) {
|
|
|
|
+ collects = Arrays.stream(correct.split(",")).map(Integer::parseInt).collect(Collectors.toSet());
|
|
|
|
+ }
|
|
List<AnswerContrast> contrasts = convertAnswerContrast(contrast);
|
|
List<AnswerContrast> contrasts = convertAnswerContrast(contrast);
|
|
if (CommonUtil.isEmpty(contrasts)) {
|
|
if (CommonUtil.isEmpty(contrasts)) {
|
|
logger.info("没有错题");
|
|
logger.info("没有错题");
|
|
@@ -196,9 +202,8 @@ public class SpecialReportService {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
String[] qidss = qids.split(",");
|
|
String[] qidss = qids.split(",");
|
|
- mind.setCollectNum(0);
|
|
|
|
-// mind.setQuestionNum(qidss.length);
|
|
|
|
Set<Integer> numbers = new HashSet<>();
|
|
Set<Integer> numbers = new HashSet<>();
|
|
|
|
+ boolean mistake = false;
|
|
for (String s : qidss) {
|
|
for (String s : qidss) {
|
|
int number = 0;
|
|
int number = 0;
|
|
if (s.matches("\\d+[A-E]")) {
|
|
if (s.matches("\\d+[A-E]")) {
|
|
@@ -213,31 +218,34 @@ public class SpecialReportService {
|
|
number = Integer.parseInt(s);
|
|
number = Integer.parseInt(s);
|
|
}
|
|
}
|
|
numbers.add(number);
|
|
numbers.add(number);
|
|
- if (map.containsKey(number) && StringUtils.isNotBlank(s)) {
|
|
|
|
|
|
+ if (map.containsKey(number) && StringUtils.isBlank(map.get(number))) {
|
|
|
|
+ //没做题
|
|
|
|
+ mistake = true;
|
|
|
|
+ } else if (map.containsKey(number)) {
|
|
String options = map.get(number);
|
|
String options = map.get(number);
|
|
- if (s.contains(options)) {
|
|
|
|
- mind.setCollectNum(mind.getCollectNum() + 1);
|
|
|
|
|
|
+ if (!s.contains(options)) {
|
|
|
|
+ //做错题
|
|
|
|
+ mistake = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- stepNumbers.put(mind.getStep(), numbers);
|
|
|
|
|
|
+ Set<Integer> nums = stepNumbers.getOrDefault(mind.getStep(),new HashSet<>());
|
|
|
|
+ nums.addAll(numbers);
|
|
|
|
+ stepNumbers.put(mind.getStep(), nums);
|
|
//设置这个问题有没有错误
|
|
//设置这个问题有没有错误
|
|
- mind.setMistake(!mind.getQuestionNum().equals(mind.getCollectNum()));
|
|
|
|
|
|
+ mind.setMistake(mistake);
|
|
}
|
|
}
|
|
Map<String, List<SpecialMind>> group = list.stream().collect(Collectors.groupingBy(SpecialMind::getStep));
|
|
Map<String, List<SpecialMind>> group = list.stream().collect(Collectors.groupingBy(SpecialMind::getStep));
|
|
List<SpecialMindVo> vos = new ArrayList<>();
|
|
List<SpecialMindVo> vos = new ArrayList<>();
|
|
for (Map.Entry<String, List<SpecialMind>> entry : group.entrySet()) {
|
|
for (Map.Entry<String, List<SpecialMind>> entry : group.entrySet()) {
|
|
String step = entry.getKey();
|
|
String step = entry.getKey();
|
|
List<SpecialMind> minds = entry.getValue();
|
|
List<SpecialMind> minds = entry.getValue();
|
|
- int collectNum = 0;
|
|
|
|
- int questionNum = 0;
|
|
|
|
- for (SpecialMind mind : minds) {
|
|
|
|
- collectNum += mind.getCollectNum();
|
|
|
|
-// questionNum += mind.getQuestionNum();
|
|
|
|
- }
|
|
|
|
- questionNum = stepNumbers.getOrDefault(entry.getKey(), new HashSet<>()).size();
|
|
|
|
|
|
+ Set<Integer> numbers = stepNumbers.getOrDefault(entry.getKey(), new HashSet<>());
|
|
|
|
+ int questionNum = numbers.size();
|
|
|
|
+ numbers.retainAll(collects);
|
|
|
|
+ int collectNum = numbers.size();
|
|
if (questionNum == 0) {
|
|
if (questionNum == 0) {
|
|
- logger.error("一整个步骤都没考");
|
|
|
|
|
|
+ logger.error("一整个步骤都没考,step={}", step);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
SpecialMindVo vo = new SpecialMindVo();
|
|
SpecialMindVo vo = new SpecialMindVo();
|