|
@@ -418,7 +418,7 @@ public class MsPaperQtypeService {
|
418
|
418
|
msPaperAnalyzeMapper.insertUseGeneratedKeys(epa);
|
419
|
419
|
} else {
|
420
|
420
|
epa.setMpaid(existEpa.getMpaid());
|
421
|
|
- msPaperAnalyzeMapper.updateByPrimaryKeySelective(epa);
|
|
421
|
+ msPaperAnalyzeMapper.updateByPrimaryKey(epa);
|
422
|
422
|
}
|
423
|
423
|
}
|
424
|
424
|
|
|
@@ -717,8 +717,10 @@ public class MsPaperQtypeService {
|
717
|
717
|
}
|
718
|
718
|
|
719
|
719
|
List<Map<String, Object>> qpoints = q.getPoints();
|
720
|
|
- // 存放知识点
|
721
|
|
- setPaperQuestionPointScore(pointqlist, quesplist, qpoints, q, null, null);
|
|
720
|
+ if(qpoints != null) {
|
|
721
|
+ // 存放知识点
|
|
722
|
+ setPaperQuestionPointScore(pointqlist, quesplist, qpoints, q, null, null);
|
|
723
|
+ }
|
722
|
724
|
}
|
723
|
725
|
|
724
|
726
|
double znumrate = N_Utils.getIntegerDivideAndMulitiply(znum, paper.getPnum());
|
|
@@ -869,7 +871,7 @@ public class MsPaperQtypeService {
|
869
|
871
|
msPaperAnalyzeMapper.insertUseGeneratedKeys(epa);
|
870
|
872
|
} else {
|
871
|
873
|
epa.setMpaid(existEpa.getMpaid());
|
872
|
|
- msPaperAnalyzeMapper.updateByPrimaryKeySelective(epa);
|
|
874
|
+ msPaperAnalyzeMapper.updateByPrimaryKey(epa);
|
873
|
875
|
}
|
874
|
876
|
}
|
875
|
877
|
|
|
@@ -898,15 +900,11 @@ public class MsPaperQtypeService {
|
898
|
900
|
for (MsPaperQtypeQuestion tq : questions) {
|
899
|
901
|
if (N_Utils.isTrueInteger(tq.getMptqid()) && N_Utils.isNotEmpty(tq.getQanswer())) {
|
900
|
902
|
MsPaperQtypeQuestion yq = yqlist.stream().filter(y -> y.getMptqid().equals(tq.getMptqid())).findFirst().orElse(null);
|
901
|
|
-
|
902
|
|
- assert yq != null;
|
903
|
|
- if (N_Utils.isObjectiveQuestion(yq.getCtype())) {
|
|
903
|
+ if(yq!=null && yq.getQtype() == 1){
|
904
|
904
|
if (!tq.getQanswer().equalsIgnoreCase(yq.getQanswer()) || !tq.getLoseoption().equals(yq.getLoseoption()) || !tq.getScoreset().equals(yq.getScoreset())) {
|
905
|
905
|
// 说明新设置的答案和原设置的答案不一致,则为变动的
|
906
|
906
|
tq.setCtype(yq.getCtype());
|
907
|
907
|
tq.setQscore(yq.getQscore());
|
908
|
|
- tq.setLoseoption(yq.getLoseoption());
|
909
|
|
- tq.setScoreset(yq.getScoreset());
|
910
|
908
|
changelist.add(tq);
|
911
|
909
|
}
|
912
|
910
|
}
|
|
@@ -1115,7 +1113,11 @@ public class MsPaperQtypeService {
|
1115
|
1113
|
for (MsPaperQtypeVo qtype : qtypelist) {
|
1116
|
1114
|
List<MsPaperQtypeQuestionVo> questions = qtype.getQuestions();
|
1117
|
1115
|
for (MsPaperQtypeQuestionVo question : questions) {
|
1118
|
|
- question.setQanswer(question.getAnswer());// 把试卷中设置的答案返回
|
|
1116
|
+ if(N_Utils.isNotEmpty(question.getAnswer())){
|
|
1117
|
+ //如果试卷已有答案,把试卷中设置的答案返回
|
|
1118
|
+ question.setQanswer(question.getAnswer());
|
|
1119
|
+ }
|
|
1120
|
+
|
1119
|
1121
|
}
|
1120
|
1122
|
}
|
1121
|
1123
|
paper.put("qtypes", qtypelist);
|
|
@@ -1182,14 +1184,13 @@ public class MsPaperQtypeService {
|
1182
|
1184
|
* @Param [mpid]
|
1183
|
1185
|
* @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
1184
|
1186
|
**/
|
1185
|
|
- public List<Map<String, Object>> listPaperSubjectiveQuestions(Integer mpid) {
|
1186
|
|
- MsPaper paper = msPaperMapper.getPaperBaseByMsid(mpid);
|
1187
|
|
- int[] subjectivelist = N_Utils.subjectiveList;
|
|
1187
|
+ public List<Map<String, Object>> listPaperSubjectiveQuestions(Integer mpid,Integer qtype) {
|
|
1188
|
+ MsPaper paper = msPaperMapper.selectByPrimaryKey(mpid);
|
1188
|
1189
|
List<Map<String, Object>> rtnList;
|
1189
|
1190
|
if (paper.getPtype() == 1) {
|
1190
|
|
- rtnList = msPaperQtypeMapper.listSubjectiveQuestionsTk(mpid, subjectivelist);
|
|
1191
|
+ rtnList = msPaperQtypeMapper.listSubjectiveQuestionsTk(mpid, qtype);
|
1191
|
1192
|
} else {
|
1192
|
|
- rtnList = msPaperQtypeMapper.listSubjectiveQuestionsFj(mpid, subjectivelist);
|
|
1193
|
+ rtnList = msPaperQtypeMapper.listSubjectiveQuestionsFj(mpid, qtype);
|
1193
|
1194
|
}
|
1194
|
1195
|
|
1195
|
1196
|
return rtnList;
|