|
|
|
@ -42,12 +42,14 @@ import javax.validation.constraints.NotNull;
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static cn.hutool.core.util.ObjectUtil.defaultIfNull;
|
|
|
|
|
import static cn.jlw.util.CacheUserUtil.getStudent;
|
|
|
|
|
import static cn.jlw.util.QuestionUtil.shuffleQuestion;
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
|
|
|
|
|
import static com.ibeetl.jlw.enums.QuestionLogAddTypeEnum.FINALLY_SUBMIT;
|
|
|
|
|
import static com.ibeetl.jlw.enums.QuestionLogAddTypeEnum.LOCK;
|
|
|
|
|
import static com.ibeetl.jlw.enums.ResourcesQuestionSnapshotFromTypeEnum.*;
|
|
|
|
|
import static com.ibeetl.jlw.enums.TuckOrErrorEnum.ERROR_TEST;
|
|
|
|
|
import static com.ibeetl.jlw.enums.TuckOrErrorEnum.TUCK_TEST;
|
|
|
|
@ -562,8 +564,27 @@ public class GeneralQuestionSettingService extends CoreBaseService<GeneralQuesti
|
|
|
|
|
{
|
|
|
|
|
// 做题日志关联学生, 初步提交做题日志信息,不包含学生提交的答案和得分情况
|
|
|
|
|
generalQuestionLogService.preSubmitStudentQuestionLog(studentId, generalQuestionSettingId, null, resourcesQuestionSnapshots, selectIsReSend, coreUser);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// LOCK状态的题目,需要展示已经提交的答案,其他的答案还是需要隐藏的
|
|
|
|
|
GeneralQuestionLogQuery logQuery = new GeneralQuestionLogQuery();
|
|
|
|
|
logQuery.setGeneralQuestionSettingId(generalQuestionSettingId);
|
|
|
|
|
logQuery.setQuestionLogAddType(LOCK);
|
|
|
|
|
logQuery.setOrgId(coreUser.getOrgId());
|
|
|
|
|
logQuery.setUserId(coreUser.getId());
|
|
|
|
|
logQuery.setStudentId(studentId);
|
|
|
|
|
List<GeneralQuestionLog> logList = generalQuestionLogService.getValuesByQueryNotWithPermission(logQuery);
|
|
|
|
|
|
|
|
|
|
Set<Long> snapshotIdSet = logList.stream().map(GeneralQuestionLog::getGeneralResourcesQuestionSnapshotId).collect(Collectors.toSet());
|
|
|
|
|
|
|
|
|
|
// 学生身份,需要屏蔽答案,再丢给前端
|
|
|
|
|
resourcesQuestionSnapshots.forEach(GeneralResourcesQuestionSnapshot::hideAnswer);
|
|
|
|
|
resourcesQuestionSnapshots.forEach(item -> {
|
|
|
|
|
// // LOCK状态的题目,需要展示已经提交的答案,其他的答案还是需要隐藏的
|
|
|
|
|
if (!snapshotIdSet.contains(item.getGeneralResourcesQuestionSnapshotId())) {
|
|
|
|
|
item.hideAnswer();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 考试自动交卷
|
|
|
|
|
if (EnumUtil.contains(fromTypeEnum, EXAM)) {
|
|
|
|
|