|
|
@@ -47,8 +47,8 @@ public class QuizServiceImpl implements QuizService {
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Quiz createQuiz(String name, Long uid, SlideState quizTime,
|
|
|
- Long slideId, List<String> questions){
|
|
|
- User teacher =new User();
|
|
|
+ Long slideId, List<String> questions) {
|
|
|
+ User teacher = new User();
|
|
|
teacher.setId(uid);
|
|
|
Slide slide = slideDAO.findSlideById(slideId);
|
|
|
Course course = new Course();
|
|
|
@@ -62,15 +62,18 @@ public class QuizServiceImpl implements QuizService {
|
|
|
quiz.setSlide(slide);
|
|
|
quiz.setTeacher(teacher);
|
|
|
|
|
|
- checkQuizState(quiz,slide);
|
|
|
+ checkQuizState(quiz, slide);
|
|
|
|
|
|
- quiz=quizDAO.saveAndFlush(quiz);
|
|
|
+ quiz = quizDAO.saveAndFlush(quiz);
|
|
|
return quiz;
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public String deleteQuiz(Long quizId) {
|
|
|
- Quiz quiz =quizDAO.findQuizById(quizId);
|
|
|
- if(quiz.getState()!=QuizState.NOT_STARTED){throw HelperException.of(ExceptionType.FORBIDDEN,"不能删除已经开始的测试!");}
|
|
|
+ Quiz quiz = quizDAO.findQuizById(quizId);
|
|
|
+ if (quiz.getState() != QuizState.NOT_STARTED) {
|
|
|
+ throw HelperException.of(ExceptionType.FORBIDDEN, "不能删除已经开始的测试!");
|
|
|
+ }
|
|
|
quizDAO.delete(quiz);
|
|
|
return "delete success";
|
|
|
}
|
|
|
@@ -79,17 +82,19 @@ public class QuizServiceImpl implements QuizService {
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Quiz modifyQuiz(Long quizId, String name, List<String> questions, SlideState quizTime, String slideId) {
|
|
|
|
|
|
- Quiz quiz =quizDAO.findQuizById(quizId);
|
|
|
- if(quiz.getState()!=QuizState.NOT_STARTED){throw HelperException.of(ExceptionType.FORBIDDEN,"不能修改已经开始的测试!");}
|
|
|
- if(name!=null) {
|
|
|
+ Quiz quiz = quizDAO.findQuizById(quizId);
|
|
|
+ if (quiz.getState() != QuizState.NOT_STARTED) {
|
|
|
+ throw HelperException.of(ExceptionType.FORBIDDEN, "不能修改已经开始的测试!");
|
|
|
+ }
|
|
|
+ if (name != null) {
|
|
|
quiz.setName(name);
|
|
|
}
|
|
|
- if(questions!=null) {
|
|
|
+ if (questions != null) {
|
|
|
quiz.setQuestions(questions);
|
|
|
}
|
|
|
- if(quizTime!=null) {
|
|
|
+ if (quizTime != null) {
|
|
|
quiz.setQuizTime(quizTime);
|
|
|
- checkQuizState(quiz,quiz.getSlide());
|
|
|
+ checkQuizState(quiz, quiz.getSlide());
|
|
|
}
|
|
|
return quizDAO.saveAndFlush(quiz);
|
|
|
|
|
|
@@ -97,25 +102,25 @@ public class QuizServiceImpl implements QuizService {
|
|
|
|
|
|
@Override
|
|
|
public Page<Quiz> getAllBasicQuizByUser(Pageable pageable, QuizState state, Long uid) {
|
|
|
- User user=userDAO.findUserById(uid);
|
|
|
+ User user = userDAO.findUserById(uid);
|
|
|
//todo: 这里写的太狗屎了,可以用重写sql或者用实例查询
|
|
|
- if(user.getType().equals(UserType.STUDENT)){
|
|
|
+ if (user.getType().equals(UserType.STUDENT)) {
|
|
|
final Set<Long> courseIdsByStudentId = chooseDAO.findCourseIdsByStudentId(uid);
|
|
|
final Set<Course> collect = courseIdsByStudentId.stream().map(i -> {
|
|
|
Course c = new Course();
|
|
|
c.setId(i);
|
|
|
return c;
|
|
|
}).collect(Collectors.toSet());
|
|
|
- if(state!=null){
|
|
|
- return quizDAO.findAllByCourseInAndState(collect,state,pageable);
|
|
|
- }else{
|
|
|
- return quizDAO.findAllByCourseIn(collect,pageable);
|
|
|
+ if (state != null) {
|
|
|
+ return quizDAO.findAllByCourseInAndState(collect, state, pageable);
|
|
|
+ } else {
|
|
|
+ return quizDAO.findAllByCourseIn(collect, pageable);
|
|
|
}
|
|
|
- }else{
|
|
|
- if(state!=null){
|
|
|
- return quizDAO.findByTeacherAndState(user,state,pageable);
|
|
|
- }else{
|
|
|
- return quizDAO.findByTeacher(user,pageable);
|
|
|
+ } else {
|
|
|
+ if (state != null) {
|
|
|
+ return quizDAO.findByTeacherAndState(user, state, pageable);
|
|
|
+ } else {
|
|
|
+ return quizDAO.findByTeacher(user, pageable);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -124,20 +129,22 @@ public class QuizServiceImpl implements QuizService {
|
|
|
|
|
|
@Override
|
|
|
public List<QuizResultVO> getQuizResult(Long quizId) {
|
|
|
- Assert.notNull(quizId,"错误的测试!");
|
|
|
+ Assert.notNull(quizId, "错误的测试!");
|
|
|
final Quiz quiz = quizDAO.findQuizById(quizId);
|
|
|
- if(quiz.getState()!=QuizState.CLOSED){throw new RuntimeException("测试未关闭,无法得到测试结果");}
|
|
|
- List<QuizResultVO> retList=new ArrayList<>();
|
|
|
+ if (quiz.getState() != QuizState.CLOSED) {
|
|
|
+ throw new RuntimeException("测试未关闭,无法得到测试结果");
|
|
|
+ }
|
|
|
+ List<QuizResultVO> retList = new ArrayList<>();
|
|
|
final List<StudentScore> studentScoreList = quiz.getStudentScore();
|
|
|
- Map<Long,List<QuizStudentAnswer>> idQuizStudentAnswerMap=new HashMap<>();
|
|
|
- for(QuizStudentAnswer qsa:quizStudentAnswerDAO.findAllByQuiz(quiz)){
|
|
|
+ Map<Long, List<QuizStudentAnswer>> idQuizStudentAnswerMap = new HashMap<>();
|
|
|
+ for (QuizStudentAnswer qsa : quizStudentAnswerDAO.findAllByQuiz(quiz)) {
|
|
|
idQuizStudentAnswerMap.computeIfAbsent(qsa.getStudent().getId(), k -> new ArrayList<>());
|
|
|
idQuizStudentAnswerMap.get(qsa.getStudent().getId()).add(qsa);
|
|
|
}
|
|
|
- for(StudentScore studentScore:studentScoreList){
|
|
|
+ for (StudentScore studentScore : studentScoreList) {
|
|
|
final User student = studentScore.getStudent();
|
|
|
final List<QuizStudentAnswer> list = idQuizStudentAnswerMap.get(student.getId());
|
|
|
- retList.add(new QuizResultVO(studentScore,student,list));
|
|
|
+ retList.add(new QuizResultVO(studentScore, student, list));
|
|
|
}
|
|
|
return retList;
|
|
|
}
|
|
|
@@ -145,80 +152,90 @@ public class QuizServiceImpl implements QuizService {
|
|
|
@Override
|
|
|
public void modifySlideState(Slide slide) {
|
|
|
final List<Quiz> quizzes = quizDAO.findAllBySlide(slide);
|
|
|
- quizzes.forEach(quiz->checkQuizState(quiz,slide));
|
|
|
+ quizzes.forEach(quiz -> checkQuizState(quiz, slide));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Integer upStudentAnswer(Long quizId, Long uid, List<QuestionStudentAnswerDTO> answers) {
|
|
|
- Assert.notNull(quizId,"错误的测试!");
|
|
|
+ Assert.notNull(quizId, "错误的测试!");
|
|
|
final Quiz quiz = quizDAO.findQuizById(quizId);
|
|
|
- if(quiz.getState()!=QuizState.ONGOING){throw HelperException.of(ExceptionType.FORBIDDEN,"不能提交尚未开始或已经结束的作业!");}
|
|
|
- User student =new User();student.setId(uid);
|
|
|
- Set<QuizStudentAnswer> quizAnswers = quizStudentAnswerDAO.findByStudentAndQuiz(student,quiz);
|
|
|
+ if (quiz.getState() != QuizState.ONGOING) {
|
|
|
+ throw HelperException.of(ExceptionType.FORBIDDEN, "不能提交尚未开始或已经结束的作业!");
|
|
|
+ }
|
|
|
+ User student = new User();
|
|
|
+ student.setId(uid);
|
|
|
+ Set<QuizStudentAnswer> quizAnswers = quizStudentAnswerDAO.findByStudentAndQuiz(student, quiz);
|
|
|
Set<String> questionIdSet = new HashSet<>(quiz.getQuestions());
|
|
|
- Map<String,QuizStudentAnswer> qsaMap=new HashMap<>(questionIdSet.size());
|
|
|
- for(QuizStudentAnswer qsa: quizAnswers){
|
|
|
- qsaMap.put(qsa.getQuestionId(),qsa);
|
|
|
+ Map<String, QuizStudentAnswer> qsaMap = new HashMap<>(questionIdSet.size());
|
|
|
+ for (QuizStudentAnswer qsa : quizAnswers) {
|
|
|
+ qsaMap.put(qsa.getQuestionId(), qsa);
|
|
|
}
|
|
|
//确定被更新或者新建的学生答案提交
|
|
|
- List<QuizStudentAnswer> quizStudentAnswers=new ArrayList<>();
|
|
|
- for(QuestionStudentAnswerDTO studentAnswer:answers){
|
|
|
+ List<QuizStudentAnswer> quizStudentAnswers = new ArrayList<>();
|
|
|
+ for (QuestionStudentAnswerDTO studentAnswer : answers) {
|
|
|
String id = studentAnswer.getQuestionId();
|
|
|
String answer = studentAnswer.getStudentAnswer().toString();
|
|
|
- if(!questionIdSet.contains(id)){break;}
|
|
|
- if(qsaMap.get(id)!=null){
|
|
|
- if(qsaMap.get(id).getStudentAnswer().equals(answer)){
|
|
|
+ if (!questionIdSet.contains(id)) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (qsaMap.get(id) != null) {
|
|
|
+ if (qsaMap.get(id).getStudentAnswer().equals(answer)) {
|
|
|
continue;
|
|
|
}
|
|
|
qsaMap.get(id).setStudentAnswer(answer);
|
|
|
System.out.println(answer);
|
|
|
quizStudentAnswers.add(qsaMap.get(id));
|
|
|
- }else {
|
|
|
- QuizStudentAnswer qsa=QuizStudentAnswer.builder()
|
|
|
+ } else {
|
|
|
+ QuizStudentAnswer qsa = QuizStudentAnswer.builder()
|
|
|
.questionId(id).quiz(quiz).student(student).studentAnswer(answer)
|
|
|
.build();
|
|
|
quizStudentAnswers.add(qsa);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- Integer savedNum=quizStudentAnswers.size();
|
|
|
+ Integer savedNum = quizStudentAnswers.size();
|
|
|
quizStudentAnswerDAO.saveAll(quizStudentAnswers);
|
|
|
return savedNum;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Page<Quiz> getAllBasicQuizBySlide(Long slideId, Pageable pageable, QuizState state, Long uid) {
|
|
|
- Assert.notNull(slideId,"错误的幻灯片!");
|
|
|
- Slide slide=new Slide();
|
|
|
+ Assert.notNull(slideId, "错误的幻灯片!");
|
|
|
+ Slide slide = new Slide();
|
|
|
slide.setId(slideId);
|
|
|
- if(state!=null) {
|
|
|
+ if (state != null) {
|
|
|
return quizDAO.findAllBySlideAndState(slide, state, pageable);
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return quizDAO.findAllBySlide(slide, pageable);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public QuizState checkQuizState(Quiz quiz, Slide slide) {
|
|
|
int quizTime = quiz.getQuizTime().getNum();
|
|
|
int slideTime = slide.getState().getNum();
|
|
|
- if (quiz.getId() == null){
|
|
|
+ if (quiz.getId() == null) {
|
|
|
//未持久化的quiz
|
|
|
quiz.setState(slideTime < quizTime ? QuizState.NOT_STARTED : QuizState.ONGOING);
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
//持久化后,不仅仅需要推进状态,还需要判分,保存等步骤
|
|
|
if (slideTime < quizTime) {
|
|
|
- if(quiz.getState().equals(QuizState.NOT_STARTED)){return QuizState.NOT_STARTED;}
|
|
|
+ if (quiz.getState().equals(QuizState.NOT_STARTED)) {
|
|
|
+ return QuizState.NOT_STARTED;
|
|
|
+ }
|
|
|
//未开始
|
|
|
quiz.setState(QuizState.NOT_STARTED);
|
|
|
} else if (slideTime == quizTime) {
|
|
|
- if(quiz.getState().equals(QuizState.ONGOING)){return QuizState.ONGOING;}
|
|
|
+ if (quiz.getState().equals(QuizState.ONGOING)) {
|
|
|
+ return QuizState.ONGOING;
|
|
|
+ }
|
|
|
quiz.setState(QuizState.ONGOING);
|
|
|
} else {
|
|
|
- if(quiz.getState().equals(QuizState.CLOSED)){return QuizState.CLOSED;}
|
|
|
+ if (quiz.getState().equals(QuizState.CLOSED)) {
|
|
|
+ return QuizState.CLOSED;
|
|
|
+ }
|
|
|
quiz.setState(QuizState.CLOSED);
|
|
|
Set<QuizStudentAnswer> quizAnswers = quizStudentAnswerDAO.findAllByQuiz(quiz);
|
|
|
final Set<Long> studentIds = chooseDAO.findStudentIdsByCourseId(slide.getCourseId());
|
|
|
@@ -239,108 +256,123 @@ public class QuizServiceImpl implements QuizService {
|
|
|
}
|
|
|
return quiz.getState();
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public QuizState checkQuizState(Long quizId, Long slideId){
|
|
|
- Quiz quiz=quizDAO.findQuizById(quizId);
|
|
|
- Slide slide=slideDAO.findSlideById(slideId);
|
|
|
- return checkQuizState(quiz,slide);
|
|
|
+ public QuizState checkQuizState(Long quizId, Long slideId) {
|
|
|
+ Quiz quiz = quizDAO.findQuizById(quizId);
|
|
|
+ Slide slide = slideDAO.findSlideById(slideId);
|
|
|
+ return checkQuizState(quiz, slide);
|
|
|
}
|
|
|
+
|
|
|
private class Student2QuestionId2Answer {
|
|
|
- Map<Long,Map<String,QuizStudentAnswer>> student2QuestionId2Answer;
|
|
|
+ Map<Long, Map<String, QuizStudentAnswer>> student2QuestionId2Answer;
|
|
|
+
|
|
|
Student2QuestionId2Answer(Set<Long> studentIds, Integer quizQuestionSize) {
|
|
|
- student2QuestionId2Answer =new LinkedHashMap<>(studentIds.size());
|
|
|
- for(Long studentId:studentIds){
|
|
|
- Map<String,QuizStudentAnswer> questionId2Answer= new LinkedHashMap<>(quizQuestionSize);
|
|
|
- student2QuestionId2Answer.put(studentId,questionId2Answer);
|
|
|
+ student2QuestionId2Answer = new LinkedHashMap<>(studentIds.size());
|
|
|
+ for (Long studentId : studentIds) {
|
|
|
+ Map<String, QuizStudentAnswer> questionId2Answer = new LinkedHashMap<>(quizQuestionSize);
|
|
|
+ student2QuestionId2Answer.put(studentId, questionId2Answer);
|
|
|
}
|
|
|
}
|
|
|
- void addAnswer(QuizStudentAnswer answers){
|
|
|
+
|
|
|
+ void addAnswer(QuizStudentAnswer answers) {
|
|
|
Map<String, QuizStudentAnswer> stringQuizStudentAnswerMap = student2QuestionId2Answer.get(answers.getStudent().getId());
|
|
|
- if(stringQuizStudentAnswerMap==null){
|
|
|
- return ;
|
|
|
+ if (stringQuizStudentAnswerMap == null) {
|
|
|
+ return;
|
|
|
}
|
|
|
- stringQuizStudentAnswerMap.put(answers.getQuestionId(),answers);
|
|
|
+ stringQuizStudentAnswerMap.put(answers.getQuestionId(), answers);
|
|
|
}
|
|
|
- void fullAnswer(Quiz quiz){
|
|
|
- List<String> questions=quiz.getQuestions();
|
|
|
- student2QuestionId2Answer.forEach((studentId, map)->{
|
|
|
- if(questions.size()!=map.size()){
|
|
|
- for(String questionId:questions){
|
|
|
- if(map.get(questionId)==null){
|
|
|
- User student =new User();student.setId(studentId);
|
|
|
- QuizStudentAnswer qsa=QuizStudentAnswer.builder()
|
|
|
+
|
|
|
+ void fullAnswer(Quiz quiz) {
|
|
|
+ List<String> questions = quiz.getQuestions();
|
|
|
+ student2QuestionId2Answer.forEach((studentId, map) -> {
|
|
|
+ if (questions.size() != map.size()) {
|
|
|
+ for (String questionId : questions) {
|
|
|
+ if (map.get(questionId) == null) {
|
|
|
+ User student = new User();
|
|
|
+ student.setId(studentId);
|
|
|
+ QuizStudentAnswer qsa = QuizStudentAnswer.builder()
|
|
|
.questionId(questionId).quiz(quiz).student(student)
|
|
|
.build();
|
|
|
- map.put(questionId,qsa);
|
|
|
+ map.put(questionId, qsa);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- void checkAnswerAndFullPass(List<BaseQuestionVO> questionVos, Quiz quiz){
|
|
|
- if(quiz.getStudentScore()==null){quiz.setStudentScore(new ArrayList<>(student2QuestionId2Answer.size()));}
|
|
|
- student2QuestionId2Answer.forEach((studentId, map)->{
|
|
|
- int passCount=0;
|
|
|
- for(BaseQuestionVO vo:questionVos){
|
|
|
+
|
|
|
+ void checkAnswerAndFullPass(List<BaseQuestionVO> questionVos, Quiz quiz) {
|
|
|
+ if (quiz.getStudentScore() == null) {
|
|
|
+ quiz.setStudentScore(new ArrayList<>(student2QuestionId2Answer.size()));
|
|
|
+ }
|
|
|
+ student2QuestionId2Answer.forEach((studentId, map) -> {
|
|
|
+ int passCount = 0;
|
|
|
+ for (BaseQuestionVO vo : questionVos) {
|
|
|
final String studentAnswer = map.get(vo.getQuestionId()).getStudentAnswer();
|
|
|
- boolean pass=vo.checkAnswer(studentAnswer);
|
|
|
- if(pass){passCount++;}
|
|
|
+ boolean pass = vo.checkAnswer(studentAnswer);
|
|
|
+ if (pass) {
|
|
|
+ passCount++;
|
|
|
+ }
|
|
|
map.get(vo.getQuestionId()).setPass(pass);
|
|
|
}
|
|
|
- Double score = (100.0*passCount)/questionVos.size();
|
|
|
- User student =new User();student.setId(studentId);
|
|
|
- StudentScore studentScore=new StudentScore();
|
|
|
+ Double score = (100.0 * passCount) / questionVos.size();
|
|
|
+ User student = new User();
|
|
|
+ student.setId(studentId);
|
|
|
+ StudentScore studentScore = new StudentScore();
|
|
|
studentScore.setQuizId(quiz.getId());
|
|
|
studentScore.setScore(Long.valueOf(Math.round(score)).intValue());
|
|
|
studentScore.setStudent(student);
|
|
|
quiz.getStudentScore().add(studentScore);
|
|
|
});
|
|
|
}
|
|
|
- List<QuizStudentAnswer> getAll(){
|
|
|
- List<QuizStudentAnswer> list=new ArrayList<>();
|
|
|
- for(Long sid: student2QuestionId2Answer.keySet()){
|
|
|
+
|
|
|
+ List<QuizStudentAnswer> getAll() {
|
|
|
+ List<QuizStudentAnswer> list = new ArrayList<>();
|
|
|
+ for (Long sid : student2QuestionId2Answer.keySet()) {
|
|
|
list.addAll(student2QuestionId2Answer.get(sid).values());
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public QuizVO combineQuiz(Long quizId){
|
|
|
- Assert.notNull(quizId,"错误的测试!");
|
|
|
+ public QuizVO combineQuiz(Long quizId) {
|
|
|
+ Assert.notNull(quizId, "错误的测试!");
|
|
|
final Quiz quizById = quizDAO.findQuizById(quizId);
|
|
|
final List<BaseQuestionVO> questionVoS = bokUtil.bokFindByIdIn(quizById.getQuestions());
|
|
|
- return new QuizVO(quizById,questionVoS);
|
|
|
+ return new QuizVO(quizById, questionVoS);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
- public QuizVO combineQuizWithAnswer(Long quizId, Long uid,UserType userType){
|
|
|
- Assert.notNull(quizId,"错误的测试!");
|
|
|
+ public QuizVO combineQuizWithAnswer(Long quizId, Long uid, UserType userType) {
|
|
|
+ Assert.notNull(quizId, "错误的测试!");
|
|
|
final Quiz quizById = quizDAO.findQuizById(quizId);
|
|
|
- User student =new User();
|
|
|
+ User student = new User();
|
|
|
student.setId(uid);
|
|
|
|
|
|
- if(userType==null||userType.equals(UserType.TEACHER)){
|
|
|
+ if (userType == null || userType.equals(UserType.TEACHER)) {
|
|
|
//向老师展示
|
|
|
List<BaseQuestionVO> questionVoS = bokUtil.bokFindByIdIn(quizById.getQuestions());
|
|
|
- return new QuizVO(quizById,questionVoS);
|
|
|
+ return new QuizVO(quizById, questionVoS);
|
|
|
}
|
|
|
- if(quizById.getState().equals(QuizState.NOT_STARTED)){
|
|
|
+ if (quizById.getState().equals(QuizState.NOT_STARTED)) {
|
|
|
//未开始看不到题目
|
|
|
return new QuizVO(quizById);
|
|
|
}
|
|
|
|
|
|
List<BaseQuestionVO> questionVos = bokUtil.bokFindByIdIn(quizById.getQuestions());
|
|
|
- final Set<QuizStudentAnswer> quizAnswers = quizStudentAnswerDAO.findByStudentAndQuiz(student,quizById);
|
|
|
- Map<String,QuizStudentAnswer> qsaMap=new HashMap<>(quizAnswers.size());
|
|
|
- for(QuizStudentAnswer qsa: quizAnswers){
|
|
|
- qsaMap.put(qsa.getQuestionId(),qsa);
|
|
|
+ final Set<QuizStudentAnswer> quizAnswers = quizStudentAnswerDAO.findByStudentAndQuiz(student, quizById);
|
|
|
+ Map<String, QuizStudentAnswer> qsaMap = new HashMap<>(quizAnswers.size());
|
|
|
+ for (QuizStudentAnswer qsa : quizAnswers) {
|
|
|
+ qsaMap.put(qsa.getQuestionId(), qsa);
|
|
|
}
|
|
|
- for(BaseQuestionVO vo:questionVos){
|
|
|
- if(qsaMap.get(vo.getQuestionId())!=null){
|
|
|
+ for (BaseQuestionVO vo : questionVos) {
|
|
|
+ if (qsaMap.get(vo.getQuestionId()) != null) {
|
|
|
vo.exAddAnswer(qsaMap.get(vo.getQuestionId()));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return new QuizVO(quizById,questionVos);
|
|
|
+ return new QuizVO(quizById, questionVos);
|
|
|
}
|
|
|
|
|
|
|