【修改】试题编号,学生进入考试参数返回增加试卷编号
This commit is contained in:
@@ -132,13 +132,13 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>5.2.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.1.2</version>
|
||||
<version>5.2.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -146,6 +146,11 @@
|
||||
<artifactId>xmlbeans</artifactId>
|
||||
<version>5.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-lite</artifactId>
|
||||
<version>5.2.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.afterturn</groupId>
|
||||
|
@@ -10,6 +10,7 @@ import java.util.List;
|
||||
@Data
|
||||
public class ExamPaperVo {
|
||||
String paperId;
|
||||
String paperNum;
|
||||
List<ExamQuestion> examQuestionList;
|
||||
List<EducationPaperScheme> educationPaperSchemeList;
|
||||
EducationPaperParam educationPaperParam;
|
||||
|
@@ -29,4 +29,6 @@ public class QuestionVo extends PageParam {
|
||||
|
||||
private String status;
|
||||
|
||||
private String quNum;
|
||||
|
||||
}
|
||||
|
@@ -37,6 +37,8 @@ public class ExamQuestion extends TenantBaseDO {
|
||||
// @Excel(name = "题库名称")
|
||||
private String quBankName;
|
||||
|
||||
private String quNum;
|
||||
|
||||
/** 章节名称 */
|
||||
// @Excel(name = "章节名称")
|
||||
private String chapteridDictText;
|
||||
|
@@ -40,6 +40,7 @@ public interface ExamQuestionMapper extends BaseMapperX<ExamQuestion>
|
||||
*/
|
||||
default PageResult<ExamQuestion> selectExamQuestionList(QuestionVo questionVo) {
|
||||
return selectPage(questionVo, new LambdaQueryWrapperX<ExamQuestion>()
|
||||
.likeIfPresent(ExamQuestion::getQuNum, questionVo.getQuNum())
|
||||
.likeIfPresent(ExamQuestion::getQuId,questionVo.getQuId())
|
||||
.likeIfPresent(ExamQuestion::getQuLevel, questionVo.getQuLevel())
|
||||
.likeIfPresent(ExamQuestion::getCourseName , questionVo.getCourseName())
|
||||
@@ -142,4 +143,5 @@ public interface ExamQuestionMapper extends BaseMapperX<ExamQuestion>
|
||||
boolean changeStatus(@Param("quId") String quId
|
||||
,@Param("status") String status);
|
||||
|
||||
int selectCountQu();
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package pc.exam.pp.module.exam.service.paper;
|
||||
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -187,7 +188,9 @@ public class EducationPaperQuServiceImpl implements IEducationPaperQuService
|
||||
examPaperVo.setEducationPaperSchemeList(educationPaperSchemeList);
|
||||
examPaperVo.setEducationPaperParam(educationPaperParam);
|
||||
examPaperVo.setStuInfoPaper(stuInfoPaper);
|
||||
|
||||
if (StringUtils.isNotBlank(educationPaper.getNum())){
|
||||
examPaperVo.setPaperNum(educationPaper.getNum());
|
||||
}
|
||||
return examPaperVo;
|
||||
}
|
||||
|
||||
|
@@ -203,7 +203,7 @@ public class EducationPaperServiceImpl implements IEducationPaperService
|
||||
int number=educationPaperMapper.selectCountPaperList();
|
||||
|
||||
// 格式化为8位,不足前面补0
|
||||
String formattedNumber = String.format("%08d", number);
|
||||
String formattedNumber = String.format("%08d", ++number);
|
||||
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ public class EducationPaperServiceImpl implements IEducationPaperService
|
||||
int number=educationPaperMapper.selectCountPaperList();
|
||||
|
||||
// 格式化为8位,不足前面补0
|
||||
String formattedNumber = String.format("%08d", number);
|
||||
String formattedNumber = String.format("%08d", ++number);
|
||||
|
||||
|
||||
|
||||
@@ -495,7 +495,7 @@ public class EducationPaperServiceImpl implements IEducationPaperService
|
||||
String schoolName= examQuestionMapper.selectSchoolnameBytId(loginTenantId);
|
||||
stuInfoPaper.setSchoolName(schoolName);
|
||||
stuInfoPaper.setSex(SecurityFrameworkUtils.getLoginUserSEX());
|
||||
|
||||
examPaperVo.setPaperNum(formattedNumber);
|
||||
examPaperVo.setExamQuestionList(examQuestionList);
|
||||
examPaperVo.setEducationPaperSchemeList(educationPaperSchemeList);
|
||||
examPaperVo.setEducationPaperParam(educationPaperParam);
|
||||
|
@@ -130,7 +130,7 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
|
||||
educationPaperParam.setParamId(IdUtils.simpleUUID());
|
||||
educationPaperParam.setTaskId(uuid);
|
||||
educationPaperParam.setIsExamPassword("1");
|
||||
educationPaperParam.setUsb("0");
|
||||
educationPaperParam.setUsb("1");
|
||||
educationPaperParam.setSaveGrades("0");
|
||||
educationPaperParam.setDriver("C");
|
||||
educationPaperParam.setIsNumber("1");
|
||||
@@ -144,6 +144,7 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
|
||||
educationPaperParam.setIsFile("1");
|
||||
educationPaperParam.setIsNet("1");
|
||||
educationPaperParam.setIsScreen("1");
|
||||
educationPaperParam.setWarn("<p style=\"line-height: 3;\"><span style=\"font-size: 22px;\">>>请仔细核对考试信息,并认真阅读本注意事项确认无误后点【开始考试】按钮进入考试系统。</span></p><p style=\"line-height: 3;\"><span style=\"font-size: 22px;\">>>进入考试系统后,系统自动计时,考试结束前5分钟,系统将提示您存盘,请根据系统的提示交卷或存盘。</span></p><p style=\"line-height: 3;\"><span style=\"font-size: 22px;\">>>进入考试系统后,须根据系统提示进行操作,任何因为与考试无关的操作造成的成绩错误由考生自行负责。</span></p><p style=\"line-height: 3;\"><span style=\"font-size: 22px;\">>>单选试题操作完后系统会自动保存。</span></p><p style=\"line-height: 3;\"><span style=\"font-size: 22px;\">>>所有操作类科目的试题,必须在相对应的操作环境中完成操作,并在该环境中直接保存文件,不要更改文件保存路径。</span></p><p style=\"line-height: 3;\"><span style=\"font-size: 22px;\">>>Windows和网络操作题,考生按照系统提示完成相应的操作即可。</span></p><p style=\"line-height: 3;\"><span style=\"font-size: 22px;\">>>考试时间结束后,系统会自动提交考生答卷到考试服务器。提前完成的考生,选择【交卷】按钮提交试卷,出现【交卷成功】提示后方可离开,不要关闭交卷成功窗口,否则后果自负。</span></p><p style=\"line-height: 3;\"><span style=\"font-size: 22px;\">>>如在考试过程中有任何疑问请举手与监考老师联系。</span></p><p><br></p>");
|
||||
educationPaperParam.setIsContent("1");
|
||||
if ("1".equals(educationPaperTask.getTaskType())){
|
||||
educationPaperParam.setIsRepeat("1");
|
||||
@@ -479,7 +480,9 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
|
||||
examPaperVo.setPaperId(paperId);
|
||||
examPaperVo.setEducationPaperParam(educationPaperParam);
|
||||
examPaperVo.setStuInfoPaper(stuInfoPaper);
|
||||
|
||||
if (StringUtils.isNotBlank(educationPaper.getNum())){
|
||||
examPaperVo.setPaperNum(educationPaper.getNum());
|
||||
}
|
||||
return examPaperVo;
|
||||
}
|
||||
|
||||
|
@@ -147,7 +147,7 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
if (fileUploads!=null&&fileUploads.size()>0){
|
||||
fileUploads.replaceAll(fileUpload -> {
|
||||
// 设置文件名(如果文件名为空)
|
||||
if (!StringUtils.isNotBlank(fileUpload.getFileName())) {
|
||||
if (StringUtils.isBlank(fileUpload.getFileName())) {
|
||||
switch (fileUpload.getFileType()) {
|
||||
case "0":
|
||||
fileUpload.setFileName("素材");
|
||||
@@ -163,9 +163,7 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(fileUpload.getFileName())) {
|
||||
fileUpload.setFileName(null);
|
||||
}
|
||||
|
||||
// 设置 fileId 和 quId
|
||||
fileUpload.setFileId(IdUtils.simpleUUID());
|
||||
fileUpload.setQuId(uuid);
|
||||
@@ -190,6 +188,13 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
examQuestionKeywordMapper.insertExamQuestionKeywordList(examQuestionKeywords);
|
||||
}
|
||||
// return examQuestionMapper.insert(examQuestion);
|
||||
Long loginTenantId = SecurityFrameworkUtils.getLoginTenantId();
|
||||
int count= examQuestionMapper.selectCountQu();
|
||||
|
||||
// 格式化为8位,不足前面补0
|
||||
String formattedNumber = String.format("%08d", ++count);
|
||||
String quNum =loginTenantId +"-"+formattedNumber;
|
||||
examQuestion.setQuNum(quNum);
|
||||
return examQuestionMapper.insertExamQuestion(examQuestion);
|
||||
}
|
||||
|
||||
@@ -233,7 +238,7 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
//赋值
|
||||
fileUploads.replaceAll(fileUpload -> {
|
||||
// 设置文件名(如果文件名为空)
|
||||
if (!StringUtils.isNotBlank(fileUpload.getFileName())) {
|
||||
if (StringUtils.isBlank(fileUpload.getFileName())) {
|
||||
switch (fileUpload.getFileType()) {
|
||||
case "0":
|
||||
fileUpload.setFileName("素材");
|
||||
@@ -249,9 +254,7 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(fileUpload.getFileName())) {
|
||||
fileUpload.setFileName(null);
|
||||
}
|
||||
|
||||
// 设置 fileId 和 quId
|
||||
fileUpload.setFileId(IdUtils.simpleUUID());
|
||||
fileUpload.setQuId(examQuestion.getQuId());
|
||||
@@ -693,6 +696,15 @@ public class ExamQuestionServiceImpl implements IExamQuestionService
|
||||
if ("选择题".equals(importUser.getSubjectName())){
|
||||
String quId = IdUtils.simpleUUID();
|
||||
ExamQuestion examQuestion = new ExamQuestion();
|
||||
|
||||
Long loginTenantId = SecurityFrameworkUtils.getLoginTenantId();
|
||||
int count= examQuestionMapper.selectCountQu();
|
||||
|
||||
// 格式化为8位,不足前面补0
|
||||
String formattedNumber = String.format("%08d", ++count);
|
||||
String quNum =loginTenantId +"-"+formattedNumber;
|
||||
examQuestion.setQuNum(quNum);
|
||||
|
||||
examQuestion.setChapteridDictText(importUser.getChapteridDictText());
|
||||
examQuestion.setSpecialtyName(importUser.getSpecialtyName());
|
||||
examQuestion.setCourseName(importUser.getCourseName());
|
||||
|
@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<resultMap type="ExamQuestion" id="ExamQuestionResult">
|
||||
<result property="quId" column="qu_id" />
|
||||
<result property="quBankId" column="qu_bank_id" />
|
||||
<result property="quNum" column="qu_num" />
|
||||
<result property="quBankName" column="qu_bank_name" />
|
||||
<result property="chapteridDictText" column="chapterId_dict_text" />
|
||||
<result property="subjectName" column="subject_name" />
|
||||
@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="ququeName" column="queue_name" />
|
||||
</resultMap>
|
||||
<sql id="selectExamQuestionVo">
|
||||
select qu_id, qu_bank_id, qu_bank_name, chapterId_dict_text,subject_name, qu_level,
|
||||
select qu_id, qu_bank_id, qu_num,qu_bank_name, chapterId_dict_text,subject_name, qu_level,
|
||||
content, content_text, analysis, point_names, keywords, manual, create_time, creator, update_time, updater, deleted ,status,audit ,course_name, specialty_name from exam_question
|
||||
</sql>
|
||||
|
||||
@@ -128,6 +129,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectSchoolnameBytId" resultType="java.lang.String">
|
||||
select name from system_tenant where id =#{loginTenantId}
|
||||
</select>
|
||||
<select id="selectCountQu" resultType="java.lang.Integer">
|
||||
select count(*) from exam_question
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertExamQuestion" parameterType="ExamQuestion">
|
||||
@@ -135,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="quId != null">qu_id,</if>
|
||||
<if test="quBankId != null">qu_bank_id,</if>
|
||||
<if test="quNum != null">qu_num,</if>
|
||||
<if test="quBankName != null">qu_bank_name,</if>
|
||||
<if test="chapteridDictText != null">chapterId_dict_text,</if>
|
||||
<if test="subjectName != null">subject_name,</if>
|
||||
@@ -159,6 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="quId != null">#{quId},</if>
|
||||
<if test="quBankId != null">#{quBankId},</if>
|
||||
<if test="quNum != null">#{quNum},</if>
|
||||
<if test="quBankName != null">#{quBankName},</if>
|
||||
<if test="chapteridDictText != null">#{chapteridDictText},</if>
|
||||
<if test="subjectName != null">#{subjectName},</if>
|
||||
|
@@ -146,13 +146,14 @@ public class EndStuMonitorUtils {
|
||||
|
||||
|
||||
}
|
||||
//练习下的任务 结束改为 代考 其他为结束
|
||||
if ("0".equals(educationPaperTask.getTaskType())){
|
||||
info.setExamStatus("0");
|
||||
stringRedisTemplate.opsForValue().set(key, JsonUtils.toJsonString(info));
|
||||
}else {
|
||||
//考试下的任务 结束改为 结束 其他为待考
|
||||
if ("1".equals(educationPaperTask.getTaskType())){
|
||||
info.setExamStatus("2");
|
||||
redisTemplate.delete(key);
|
||||
|
||||
}else {
|
||||
info.setExamStatus("0");
|
||||
stringRedisTemplate.opsForValue().set(key, JsonUtils.toJsonString(info));
|
||||
}
|
||||
|
||||
monitorMapper.updateById(info);
|
||||
|
Reference in New Issue
Block a user