|
@@ -2,12 +2,17 @@ package cn.com.qmth.stmms.admin.exam;
|
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
+import cn.com.qmth.stmms.admin.vo.TrialMarkerVO;
|
|
|
+import cn.com.qmth.stmms.admin.vo.TrialQuestionVO;
|
|
|
import cn.com.qmth.stmms.biz.config.service.impl.SystemCache;
|
|
|
import cn.com.qmth.stmms.biz.exam.query.MarkerSearchQuery;
|
|
|
+import cn.com.qmth.stmms.biz.utils.ScoreItem;
|
|
|
import cn.com.qmth.stmms.common.enums.*;
|
|
|
import net.sf.json.JSONArray;
|
|
|
import net.sf.json.JSONObject;
|
|
@@ -120,7 +125,8 @@ public class TrialController extends BaseExamController {
|
|
|
model.addAttribute("query", query);
|
|
|
model.addAttribute("subjectList", getExamSubject(examId, wu));
|
|
|
model.addAttribute("groupList", groupList);
|
|
|
- model.addAttribute("trialMode", systemCache.getTrialMode()== null ? TrialMode.SHARE:systemCache.getTrialMode());
|
|
|
+ model.addAttribute("trialMode",
|
|
|
+ systemCache.getTrialMode() == null ? TrialMode.SHARE : systemCache.getTrialMode());
|
|
|
return "modules/exam/trialList";
|
|
|
}
|
|
|
|
|
@@ -196,10 +202,8 @@ public class TrialController extends BaseExamController {
|
|
|
} else {
|
|
|
// 裁切图配置
|
|
|
obj.accumulate("fileServer", fileService.getFileServer());
|
|
|
- obj.accumulate(
|
|
|
- "urls",
|
|
|
- fileService.getSliceUris(student.getExamId(), student.getSecretNumber(), 1,
|
|
|
- student.getSliceCount()));
|
|
|
+ obj.accumulate("urls", fileService.getSliceUris(student.getExamId(), student.getSecretNumber(), 1,
|
|
|
+ student.getSliceCount()));
|
|
|
obj.accumulate("pictureConfig", group.getPictureConfigList());
|
|
|
}
|
|
|
// 评卷记录集合
|
|
@@ -220,6 +224,7 @@ public class TrialController extends BaseExamController {
|
|
|
}
|
|
|
return obj;
|
|
|
}
|
|
|
+
|
|
|
@Logging(menu = "试评分析查询", type = LogType.QUERY)
|
|
|
@RequestMapping(value = "/marker")
|
|
|
public String marker(Model model, HttpServletRequest request, MarkerSearchQuery query) {
|
|
@@ -235,28 +240,64 @@ public class TrialController extends BaseExamController {
|
|
|
}
|
|
|
List<MarkGroup> groupList = groupService.findByExamAndSubjectAndStatus(examId, query.getSubjectCode(),
|
|
|
MarkStatus.TRIAL);
|
|
|
+ String groupTile = null;
|
|
|
+ List<ExamQuestion> questionList = new ArrayList<>();
|
|
|
if (!groupList.isEmpty()) {
|
|
|
for (MarkGroup group : groupList) {
|
|
|
- group.setQuestionList(questionService.findByExamAndSubjectAndObjectiveAndGroupNumber(examId,
|
|
|
- group.getSubjectCode(), false, group.getNumber()));
|
|
|
+ List<ExamQuestion> questions = questionService.findByExamAndSubjectAndObjectiveAndGroupNumber(examId,
|
|
|
+ group.getSubjectCode(), false, group.getNumber());
|
|
|
+ group.setQuestionList(questions);
|
|
|
+ if (query.getGroupNumber() == group.getNumber()) {
|
|
|
+ groupTile = group.getTitle();
|
|
|
+ questionList = questions;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- List<Marker> markerList = new ArrayList<Marker>();
|
|
|
+ List<TrialMarkerVO> markerList = new ArrayList<TrialMarkerVO>();
|
|
|
if (query.getGroupNumber() != null) {
|
|
|
MarkerSearchQuery mQuery = new MarkerSearchQuery();
|
|
|
mQuery.setExamId(examId);
|
|
|
mQuery.setSubjectCode(query.getSubjectCode());
|
|
|
mQuery.setGroupNumber(query.getGroupNumber());
|
|
|
mQuery.setPageSize(Integer.MAX_VALUE);
|
|
|
- markerList = markerService.findByQuery(mQuery).getResult();
|
|
|
- for (Marker marker : markerList) {
|
|
|
- marker.setLoginName(userService.findById(marker.getUserId()).getLoginName());
|
|
|
+ query = markerService.findByQuery(mQuery);
|
|
|
+ for (Marker marker : query.getResult()) {
|
|
|
+ TrialMarkerVO vo = new TrialMarkerVO();
|
|
|
+ vo.setId(marker.getId());
|
|
|
+ vo.setLoginName(userService.findById(marker.getUserId()).getLoginName());
|
|
|
+ vo.setGroupNumber(marker.getGroupNumber());
|
|
|
+ vo.setGroupTitle(groupTile);
|
|
|
+ List<TrialLibrary> libraryList = trialService.findLibraryByMarkerId(marker.getId());
|
|
|
+ Double avgScore = libraryList.stream().mapToDouble(TrialLibrary::getMarkerScore).average().getAsDouble();
|
|
|
+ vo.setAvgScore(avgScore);
|
|
|
+ Map<Integer,List<ScoreItem>> map = new HashMap<>();
|
|
|
+ for (TrialLibrary library: libraryList) {
|
|
|
+ List<ScoreItem> sList = library.getScoreList();
|
|
|
+ for (int i = 0; i < questionList.size(); i++) {
|
|
|
+ ExamQuestion question = questionList.get(i);
|
|
|
+ List<ScoreItem> qsList = map.get(question.getId());
|
|
|
+ if(qsList==null){
|
|
|
+ qsList =new ArrayList<>();
|
|
|
+ }
|
|
|
+ qsList.add(sList.get(i));
|
|
|
+ map.put(question.getId(),qsList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ List<TrialQuestionVO> list = new ArrayList<>();
|
|
|
+ for (ExamQuestion question : questionList) {
|
|
|
+ List<ScoreItem> qsList = map.get(question.getId());
|
|
|
+ TrialQuestionVO trialQuestionVO =new TrialQuestionVO();
|
|
|
+ trialQuestionVO.setAvgScore(qsList.stream().mapToDouble(ScoreItem::getScore).average().getAsDouble());
|
|
|
+ trialQuestionVO.setScoreList(StringUtils.join(qsList, ","));
|
|
|
+ }
|
|
|
+ vo.setQuestionList(list);
|
|
|
}
|
|
|
}
|
|
|
model.addAttribute("markerList", markerList);
|
|
|
model.addAttribute("query", query);
|
|
|
model.addAttribute("subjectList", getExamSubject(examId, wu));
|
|
|
model.addAttribute("groupList", groupList);
|
|
|
- return "modules/exam/trialList";
|
|
|
+ model.addAttribute("questionList", questionList);
|
|
|
+ return "modules/exam/trialMarkerList";
|
|
|
}
|
|
|
}
|