|
|
@ -16,8 +16,12 @@ import io.vavr.control.Try; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
import java.util.Collections; |
|
|
import java.util.Objects; |
|
|
import java.util.Objects; |
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
@ -65,7 +69,13 @@ public class BuildExamRecordDomainServiceImpl implements BuildExamRecordDomainSe |
|
|
if (!canShowDetails) { |
|
|
if (!canShowDetails) { |
|
|
answerSnapshotDTO.setRightAnswer(null); |
|
|
answerSnapshotDTO.setRightAnswer(null); |
|
|
answerSnapshotDTO.setAnalysis(null); |
|
|
answerSnapshotDTO.setAnalysis(null); |
|
|
|
|
|
}else if(!answerSnapshotDTO.getRightAnswer().contains(",")){ |
|
|
|
|
|
String rightAnswer = answerSnapshotDTO.getRightAnswer().chars() |
|
|
|
|
|
.mapToObj(c -> String.valueOf((char) c)) |
|
|
|
|
|
.collect(Collectors.joining(",")); |
|
|
|
|
|
answerSnapshotDTO.setRightAnswer(rightAnswer); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
answerSnapshotDTO.setIndex(index.incrementAndGet()); |
|
|
answerSnapshotDTO.setIndex(index.incrementAndGet()); |
|
|
if (Objects.isNull(answerSnapshotDTO.getHasAppealed())) { |
|
|
if (Objects.isNull(answerSnapshotDTO.getHasAppealed())) { |
|
|
answerSnapshotDTO.setHasAppealed(Boolean.FALSE); |
|
|
answerSnapshotDTO.setHasAppealed(Boolean.FALSE); |
|
|
|