|
@@ -9,7 +9,6 @@ import java.util.List;
|
|
|
import java.util.Set;
|
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.bson.types.ObjectId;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Sort;
|
|
@@ -78,18 +77,6 @@ public class PaperDetailUnitServiceImpl implements PaperDetailUnitService {
|
|
|
return Model.of(paperDetailUnitRepo.findById(id));
|
|
|
}
|
|
|
|
|
|
- private void formatSelectQuestionAnswer(Question question) {
|
|
|
- if(question.getQuestionType() == QuesStructType.MULTIPLE_ANSWER_QUESTION) {
|
|
|
- if(StringUtils.isNotBlank(question.getQuesAnswer())&&question.getQuesAnswer().indexOf(",")==-1) {
|
|
|
- String[] sarr=new String[question.getQuesAnswer().length()];
|
|
|
- for(int i=0;i<sarr.length;i++) {
|
|
|
- sarr[i]=String.valueOf(question.getQuesAnswer().charAt(i));
|
|
|
- }
|
|
|
- question.setQuesAnswer(StringUtils.join(sarr, ","));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
/**
|
|
|
* 保存小题
|
|
|
*/
|
|
@@ -101,7 +88,6 @@ public class PaperDetailUnitServiceImpl implements PaperDetailUnitService {
|
|
|
if (baseUnit.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION) {
|
|
|
if (updateQuestion.getId().equals(baseQuestion.getId())) {
|
|
|
// 更新对象为套题本身
|
|
|
- formatSelectQuestionAnswer(updateQuestion);
|
|
|
quesService.saveQues(updateQuestion);
|
|
|
baseUnit.setQuestion(updateQuestion);
|
|
|
} else {
|
|
@@ -156,7 +142,6 @@ public class PaperDetailUnitServiceImpl implements PaperDetailUnitService {
|
|
|
}
|
|
|
|
|
|
if (match) {
|
|
|
- formatSelectQuestionAnswer(baseQuestion);
|
|
|
quesService.saveQues(baseQuestion);
|
|
|
baseUnit.setQuestion(baseQuestion);
|
|
|
}
|
|
@@ -165,7 +150,6 @@ public class PaperDetailUnitServiceImpl implements PaperDetailUnitService {
|
|
|
baseUnit.setSubScoreList(subScoreList);
|
|
|
}
|
|
|
} else {
|
|
|
- formatSelectQuestionAnswer(updateQuestion);
|
|
|
quesService.saveQues(updateQuestion);
|
|
|
baseUnit.setQuestion(updateQuestion);
|
|
|
baseUnit.setScore(updateUnit.getScore());
|