feat(exam): 支持按单个学生和考试类型生成考试试题

- 修改生成试题按钮仅在选中特定一个学生时可用,避免多选时误操作
- 在考试生成对话框新增“类型”选择项,支持“摸底”和“期中|期末”类型
- 调整后台接口,使用单个学生ID和考试类型替代学生ID列表参数
- 优化考试生成服务,新增摸底考试生成逻辑,按年级分区随机抽词汇
- 考试相关数据对象新增类型字段,保持数据完整性和一致性
- 修改考试判卷服务,将错误信息字段统一为msg,避免字段混淆
- 调整数据库操作,支持单个学生考试与词汇随机获取
- 同步更新测试用例和词汇库数据插入逻辑,确保环境一致性
- 修复界面生成按钮状态和对话框提交按钮的校验逻辑,提升用户体验
This commit is contained in:
lbw
2025-12-18 17:21:37 +08:00
parent 7a66548aed
commit 065da854ee
21 changed files with 228 additions and 54 deletions

View File

@@ -1,6 +1,108 @@
package com.yinlihupo.enlish.service.constant;
public interface ExamWordsConstant {
public class ExamWordsConstant {
int PGN_COL = 53;
public static final int PGN_COL = 53;
public static final int GRADE_1 = 1;
public static final int GRADE_2 = 2;
public static final int GRADE_3 = 3;
public static final int GRADE_4 = 4;
public static final int GRADE_5 = 5;
public static final int GRADE_6 = 7;
public static final int GRADE_7 = 8;
public static final int GRADE_8 = 9;
public static final int ZONE_A_SIZE = 10;
public static final int ZONE_B_SIZE = 20;
public static final int ZONE_C_SIZE = 28;
public static final int ZONE_D_SIZE = 21;
public static final int ZONE_E_SIZE = 14;
public static final int ZONE_F_SIZE = 7;
public static final int EXAM_TYPE_BASELINE = 1;
public static int getZoneA(int gradeId) {
return switch (gradeId) {
case GRADE_1 -> GRADE_2;
case GRADE_2 -> GRADE_3;
case GRADE_3 -> GRADE_4;
case GRADE_4 -> GRADE_5;
case GRADE_5 -> GRADE_6;
case GRADE_6 -> GRADE_7;
case GRADE_7 -> GRADE_8;
default -> 0;
};
}
public static int getZoneB(int gradeId) {
return switch (gradeId) {
case GRADE_1 -> GRADE_1;
case GRADE_2 -> GRADE_2;
case GRADE_3 -> GRADE_3;
case GRADE_4 -> GRADE_4;
case GRADE_5 -> GRADE_5;
case GRADE_6 -> GRADE_6;
case GRADE_7 -> GRADE_7;
case GRADE_8 -> GRADE_8;
default -> 0;
};
}
public static int getZoneC(int gradeId) {
return switch (gradeId) {
case GRADE_1 -> GRADE_1;
case GRADE_2 -> GRADE_1;
case GRADE_3 -> GRADE_2;
case GRADE_4 -> GRADE_3;
case GRADE_5 -> GRADE_4;
case GRADE_6 -> GRADE_5;
case GRADE_7 -> GRADE_6;
case GRADE_8 -> GRADE_7;
default -> 0;
};
}
public static int getZoneD(int gradeId) {
return switch (gradeId) {
case GRADE_1 -> GRADE_1;
case GRADE_2 -> GRADE_1;
case GRADE_3 -> GRADE_1;
case GRADE_4 -> GRADE_2;
case GRADE_5 -> GRADE_3;
case GRADE_6 -> GRADE_4;
case GRADE_7 -> GRADE_5;
case GRADE_8 -> GRADE_6;
default -> 0;
};
}
public static int getZoneE(int gradeId) {
return switch (gradeId) {
case GRADE_1 -> GRADE_1;
case GRADE_2 -> GRADE_1;
case GRADE_3 -> GRADE_1;
case GRADE_4 -> GRADE_1;
case GRADE_5 -> GRADE_2;
case GRADE_6 -> GRADE_3;
case GRADE_7 -> GRADE_4;
case GRADE_8 -> GRADE_5;
default -> 0;
};
}
public static int getZoneF(int gradeId) {
return switch (gradeId) {
case GRADE_1 -> GRADE_1;
case GRADE_2 -> GRADE_1;
case GRADE_3 -> GRADE_1;
case GRADE_4 -> GRADE_1;
case GRADE_5 -> GRADE_1;
case GRADE_6 -> GRADE_2;
case GRADE_7 -> GRADE_3;
case GRADE_8 -> GRADE_4;
default -> 0;
};
}
}

View File

@@ -44,12 +44,13 @@ public class ExamWordsController {
public void generateFeltExamWords(@RequestBody GenerateExamWordsReqVO generateExamWordsReqVO, HttpServletResponse response) {
Integer gradeId = generateExamWordsReqVO.getGradeId();
Integer level = generateExamWordsReqVO.getLevel();
List<Integer> studentIds = generateExamWordsReqVO.getStudentIds();
if (studentIds == null || studentIds.isEmpty() || gradeId == null || level == null) {
Integer type = generateExamWordsReqVO.getType();
Integer studentId = generateExamWordsReqVO.getStudentId();
if (studentId == null || gradeId == null || level == null) {
throw new RuntimeException("参数错误");
}
try {
ExamWordsDO examWordsDO = examWordsService.generateExamWords(gradeId, level, studentIds);
ExamWordsDO examWordsDO = examWordsService.generateExamWords(gradeId, level, studentId, type);
if (examWordsDO == null || examWordsDO.getWordIds().isEmpty()) {
throw new RuntimeException("没有单词");
}
@@ -60,7 +61,7 @@ public class ExamWordsController {
.definition(vocabularyBankDO.getDefinition())
.build()).toList();
List<StudentDetail> studentDetailList = studentService.getStudentDetailList(studentIds);
List<StudentDetail> studentDetailList = studentService.getStudentDetailList(Collections.singletonList(studentId));
List<Map<String, Object>> maps = studentDetailList.stream().map(studentDetail -> {
Map<String, Object> data = new HashMap<>();
data.put("examId", examWordsDO.getId());
@@ -115,7 +116,7 @@ public class ExamWordsController {
.correctWordCount(examWordsJudgeResultDO.getCorrectWordCount())
.wrongWordCount(examWordsJudgeResultDO.getWrongWordCount())
.isFinished(examWordsJudgeResultDO.getIsFinished())
.errorMsg(examWordsJudgeResultDO.getErrorMsg())
.errorMsg(examWordsJudgeResultDO.getMsg())
.build()
).toList();
return PageResponse.success(list, page, total, size);
@@ -134,7 +135,7 @@ public class ExamWordsController {
.correctWordCount(examWordsJudgeResultDO.getCorrectWordCount())
.wrongWordCount(examWordsJudgeResultDO.getWrongWordCount())
.isFinished(examWordsJudgeResultDO.getIsFinished())
.errorMsg(examWordsJudgeResultDO.getErrorMsg())
.errorMsg(examWordsJudgeResultDO.getMsg())
.correctWordIds(examWordsJudgeResultDO.getCorrectWordIds())
.wrongWordIds(examWordsJudgeResultDO.getWrongWordIds())
.build();

View File

@@ -19,6 +19,8 @@ public class ExamWordsDO {
private Integer level;
private Integer type;
private String title;
private LocalDateTime createdAt;

View File

@@ -27,12 +27,14 @@ public class ExamWordsJudgeResultDO {
private Integer isFinished;
private Integer ansGradeId;
private LocalDateTime startDate;
private List<Integer> correctWordIds;
private List<Integer> wrongWordIds;
private String errorMsg;
private String msg;
}

View File

@@ -11,7 +11,7 @@ public interface ExamWordsJudgeResultDOMapper {
List<ExamWordsJudgeResultDO> selectUnfinishedExamWordsJudgeResultDOList(int count);
int updateErrorMsg(@Param("id") Integer id, @Param("errorMsg") String errorMsg);
int updateMsg(@Param("id") Integer id, @Param("msg") String msg);
int updateExamWordsJudgeResultDO(@Param("examWordsJudgeResultDO") ExamWordsJudgeResultDO examWordsJudgeResultDO);

View File

@@ -8,7 +8,7 @@ import java.util.List;
public interface StudentExamWordsDOMapper {
int insertStudentsExam(@Param("studentIds") List<Integer> studentIds, @Param("examWordsId") Integer examWordsId);
int insertStudentsExam(@Param("studentId") Integer studentId, @Param("examWordsId") Integer examWordsId);
StudentExamWordsDO selectByStudentIdAndExamWordsId(@Param("studentId") Integer studentId, @Param("examWordsId") Integer examWordsId);

View File

@@ -21,5 +21,7 @@ public interface VocabularyBankDOMapper {
List<VocabularyBankDO> selectVocabularyBankListSelfCheck(@Param("gradeId") Integer gradeId, @Param("studentId") Integer studentId, @Param("ids") List<Integer> ids, @Param("wordCount") Integer wordCount);
List<VocabularyBankDO> selectVocabularyBankListByGradeIdRandom(@Param("gradeId") Integer gradeId, @Param("wordCount") Integer wordCount);
Integer selectWordTotal();
}

View File

@@ -16,5 +16,6 @@ public class GenerateExamWordsReqVO {
private Integer gradeId;
private Integer level;
private List<Integer> studentIds;
private Integer type;
private Integer studentId;
}

View File

@@ -8,7 +8,7 @@ import java.util.List;
public interface ExamWordsService {
ExamWordsDO generateExamWords(Integer gradeId, Integer level, List<Integer> studentIds);
ExamWordsDO generateExamWords(Integer gradeId, Integer level, Integer studentId, Integer type);
int saveExamWordsPngToDbAndLocal(MultipartFile file);
}

View File

@@ -1,7 +1,9 @@
package com.yinlihupo.enlish.service.service.exam;
import com.yinlihupo.enlish.service.constant.ExamWordsConstant;
import com.yinlihupo.enlish.service.domain.dataobject.ExamWordsDO;
import com.yinlihupo.enlish.service.domain.dataobject.ExamWordsJudgeResultDO;
import com.yinlihupo.enlish.service.domain.dataobject.StudentDO;
import com.yinlihupo.enlish.service.domain.dataobject.VocabularyBankDO;
import com.yinlihupo.enlish.service.domain.mapper.*;
import com.yinlihupo.enlish.service.service.ExamWordsService;
@@ -16,6 +18,7 @@ import java.io.File;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
@@ -33,6 +36,9 @@ public class ExamWordsServiceImpl implements ExamWordsService {
private StudentExamWordsDOMapper studentExamWordsDOMapper;
@Resource
private ExamWordsJudgeResultDOMapper examWordsJudgeResultDOMapper;
@Resource
private StudentDOMapper studentDOMapper;
@Value("${templates.count}")
private Integer wordCount;
@Value("${tmp.png}")
@@ -40,23 +46,55 @@ public class ExamWordsServiceImpl implements ExamWordsService {
@Override
@Transactional(rollbackFor = RuntimeException.class)
public ExamWordsDO generateExamWords(Integer gradeId, Integer level, List<Integer> studentIds) {
public ExamWordsDO generateExamWords(Integer gradeId, Integer level, Integer studentId, Integer type) {
List<Integer> unitIds = gradeUnitDOMapper.selectUnitIdsByGradeId(gradeId);
List<VocabularyBankDO> vocabularyBankDOS = new ArrayList<>();
int count = wordCount;
for (Integer unitId : unitIds) {
List<VocabularyBankDO> words = vocabularyBankDOMapper.selectVocabularyBankDOListByUnitId(unitId, 20);
vocabularyBankDOS.addAll(words);
count -= 20;
if (count <= 0) {
break;
}
ExamWordsDO examWordsDO;
if (type == ExamWordsConstant.EXAM_TYPE_BASELINE) {
log.info("生成摸底测试");
examWordsDO = generateBaselineExamWords(studentId);
} else {
// todo 生成期中考试待实现
examWordsDO = null;
}
return examWordsDO;
}
private ExamWordsDO generateBaselineExamWords(Integer studentId) {
StudentDO studentDO = studentDOMapper.selectStudentById(studentId);
Integer gradeId = studentDO.getGradeId();
int zoneA = ExamWordsConstant.getZoneA(gradeId);
int zoneASize = ExamWordsConstant.ZONE_A_SIZE;
List<VocabularyBankDO> vocabularyBankDOS = new ArrayList<>(vocabularyBankDOMapper.selectVocabularyBankListByGradeIdRandom(zoneA, zoneASize));
int zoneB = ExamWordsConstant.getZoneB(gradeId);
int zoneBSize = ExamWordsConstant.ZONE_B_SIZE;
vocabularyBankDOS.addAll(vocabularyBankDOMapper.selectVocabularyBankListByGradeIdRandom(zoneB, zoneBSize));
int zoneC = ExamWordsConstant.getZoneC(gradeId);
int zoneCSize = ExamWordsConstant.ZONE_C_SIZE;
vocabularyBankDOS.addAll(vocabularyBankDOMapper.selectVocabularyBankListByGradeIdRandom(zoneC, zoneCSize));
int zoneD = ExamWordsConstant.getZoneD(gradeId);
int zoneDSize = ExamWordsConstant.ZONE_D_SIZE;
vocabularyBankDOS.addAll(vocabularyBankDOMapper.selectVocabularyBankListByGradeIdRandom(zoneD, zoneDSize));
int zoneE = ExamWordsConstant.getZoneE(gradeId);
int zoneESize = ExamWordsConstant.ZONE_E_SIZE;
vocabularyBankDOS.addAll(vocabularyBankDOMapper.selectVocabularyBankListByGradeIdRandom(zoneE, zoneESize));
int zoneF = ExamWordsConstant.getZoneF(gradeId);
int zoneFSize = ExamWordsConstant.ZONE_F_SIZE;
vocabularyBankDOS.addAll(vocabularyBankDOMapper.selectVocabularyBankListByGradeIdRandom(zoneF, zoneFSize));
ExamWordsDO examWordsDO = ExamWordsDO.builder()
.gradeId(gradeId)
.level(level)
.title(LocalDateTime.now() + "测试")
.level(1)
.type(ExamWordsConstant.EXAM_TYPE_BASELINE)
.title("摸低测试测试" + studentDO.getName())
.createdAt(LocalDateTime.now())
.wordIds(vocabularyBankDOS.stream().map(VocabularyBankDO::getId).toList())
.build();
@@ -66,7 +104,7 @@ public class ExamWordsServiceImpl implements ExamWordsService {
throw new RuntimeException("插入考试失败");
}
int insertStudentsExam = studentExamWordsDOMapper.insertStudentsExam(studentIds, examWordsDO.getId());
int insertStudentsExam = studentExamWordsDOMapper.insertStudentsExam(studentId, examWordsDO.getId());
if (insertStudentsExam <= 0) {
throw new RuntimeException("插入学生关联考试失败");
}

View File

@@ -51,7 +51,7 @@ public class ExamWordsJudgeServiceImpl implements ExamWordsJudgeService {
StudentExamId studentExamId = PngUtil.analyzeExamWordsIdAndStudentId(ansSheetPath, tessdataPath, coordinatesXIES);
Integer examWordsJudgeResultDOId = examWordsJudgeResultDO.getId();
if (studentExamId == null) {
examWordsJudgeResultDOMapper.updateErrorMsg(examWordsJudgeResultDOId, "未识别学生 id 和考试 id");
examWordsJudgeResultDOMapper.updateMsg(examWordsJudgeResultDOId, "未识别学生 id 和考试 id");
continue;
}
@@ -59,18 +59,18 @@ public class ExamWordsJudgeServiceImpl implements ExamWordsJudgeService {
Integer examWordsId = studentExamId.getExamId();
StudentExamWordsDO studentExamWordsDO = studentExamWordsDOMapper.selectByStudentIdAndExamWordsId(studentId, examWordsId);
if (studentExamWordsDO == null) {
examWordsJudgeResultDOMapper.updateErrorMsg(examWordsJudgeResultDOId, "未找到学生 id 和考试 id 对应的考试记录");
examWordsJudgeResultDOMapper.updateMsg(examWordsJudgeResultDOId, "未找到学生 id 和考试 id 对应的考试记录");
continue;
}
log.info("studentId:{},examWordsId:{}", studentId, examWordsId);
if (studentExamWordsDO.getIsCompleted() == 1) {
examWordsJudgeResultDOMapper.updateErrorMsg(examWordsJudgeResultDOId, "考试记录此前已识别");
examWordsJudgeResultDOMapper.updateMsg(examWordsJudgeResultDOId, "考试记录此前已识别");
continue;
}
ExamWordsDO examWordsDO = examWordsDOMapper.selectById(examWordsId);
if(examWordsDO == null) {
examWordsJudgeResultDOMapper.updateErrorMsg(examWordsJudgeResultDOId, "未找到考试");
examWordsJudgeResultDOMapper.updateMsg(examWordsJudgeResultDOId, "未找到考试");
continue;
}
@@ -90,7 +90,7 @@ public class ExamWordsJudgeServiceImpl implements ExamWordsJudgeService {
.build();
int updated = examWordsJudgeResultDOMapper.updateExamWordsJudgeResultDO(wordsJudgeResultDO);
if (updated != 1) {
examWordsJudgeResultDOMapper.updateErrorMsg(examWordsJudgeResultDOId, "更新考试记录失败");
examWordsJudgeResultDOMapper.updateMsg(examWordsJudgeResultDOId, "更新考试记录失败");
continue;
}
log.info("更新考试记录成功");
@@ -114,13 +114,13 @@ public class ExamWordsJudgeServiceImpl implements ExamWordsJudgeService {
).toList());
int batched = wordMasteryLogDOMapper.batchUpdateStudentMastery(wordMasteryLogDOS);
if (batched == 0) {
examWordsJudgeResultDOMapper.updateErrorMsg(examWordsJudgeResultDOId, "更新学生记忆力记录失败");
examWordsJudgeResultDOMapper.updateMsg(examWordsJudgeResultDOId, "更新学生记忆力记录失败");
continue;
}
int updateStudentExamWordsFinished = studentExamWordsDOMapper.updateStudentExamWordsFinished(studentId, examWordsId);
if (updateStudentExamWordsFinished != 1) {
examWordsJudgeResultDOMapper.updateErrorMsg(examWordsJudgeResultDOId, "更新学生考试为结束时失败");
examWordsJudgeResultDOMapper.updateMsg(examWordsJudgeResultDOId, "更新学生考试为结束时失败");
}
boolean delete = new File(ansSheetPath).delete();

View File

@@ -3,7 +3,6 @@ package com.yinlihupo.enlish.service.utils;
import com.yinlihupo.enlish.service.constant.ExamWordsConstant;
import com.yinlihupo.enlish.service.model.bo.CoordinatesXY;
import com.yinlihupo.enlish.service.model.bo.StudentExamId;
import com.yinlihupo.enlish.service.model.bo.Word;
import lombok.extern.slf4j.Slf4j;
import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
@@ -13,7 +12,6 @@ import org.checkerframework.checker.nullness.qual.NonNull;
import org.opencv.core.*;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;
import org.springframework.beans.factory.annotation.Value;
import java.awt.image.BufferedImage;
import java.awt.image.DataBufferByte;

View File

@@ -7,6 +7,7 @@
<result column="level" jdbcType="INTEGER" property="level" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="type" jdbcType="INTEGER" property="type" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yinlihupo.enlish.service.domain.dataobject.ExamWordsDO">
<result column="word_ids" jdbcType="LONGVARCHAR" property="wordIds" typeHandler="com.yinlihupo.enlish.service.config.ListWordIdTypeHandler" />

View File

@@ -11,7 +11,8 @@
<result column="wrong_word_count" jdbcType="INTEGER" property="wrongWordCount" />
<result column="is_finished" jdbcType="INTEGER" property="isFinished" />
<result column="start_date" jdbcType="TIMESTAMP" property="startDate" />
<result column="error_msg" jdbcType="VARCHAR" property="errorMsg" />
<result column="msg" jdbcType="VARCHAR" property="msg" />
<result column="ans_grade_id" jdbcType="INTEGER" property="ansGradeId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.yinlihupo.enlish.service.domain.dataobject.ExamWordsJudgeResultDO">
@@ -31,9 +32,9 @@
limit #{count}
</select>
<update id="updateErrorMsg">
<update id="updateMsg">
update exam_words_judge_result
set error_msg = #{errorMsg}
set msg = #{msg}
and is_finished = 2
where id = #{id}
</update>

View File

@@ -13,9 +13,7 @@
insert into student_exam_words
(student_id, exam_words_id, is_completed, start_data)
values
<foreach collection="studentIds" item="studentId" separator=",">
(#{studentId}, #{examWordsId}, 0, now())
</foreach>
</insert>
<select id="selectByStudentIdAndExamWordsId" resultMap="BaseResultMap">

View File

@@ -122,4 +122,16 @@
from vocabulary_bank
</select>
<select id="selectVocabularyBankListByGradeIdRandom" resultMap="BaseResultMap">
select *
from vocabulary_bank
where unit_id in (
select unit_id
from grade_unit
where grade_id = #{gradeId}
)
order by rand()
limit #{wordCount}
</select>
</mapper>

View File

@@ -1,7 +1,9 @@
package com.yinlihupo.enlish.service.mapper;
import com.yinlihupo.enlish.service.domain.dataobject.GradeUnitDO;
import com.yinlihupo.enlish.service.domain.dataobject.UnitDO;
import com.yinlihupo.enlish.service.domain.dataobject.VocabularyBankDO;
import com.yinlihupo.enlish.service.domain.mapper.GradeUnitDOMapper;
import com.yinlihupo.enlish.service.domain.mapper.UnitDOMapper;
import com.yinlihupo.enlish.service.domain.mapper.VocabularyBankDOMapper;
import com.yinlihupo.enlish.service.domain.mapper.WordMasteryLogDOMapper;
@@ -29,11 +31,13 @@ public class TestVocabularyBankInsert {
private UnitDOMapper unitDOMapper;
@Resource
private WordMasteryLogDOMapper wordMasteryLogDOMapper;
@Resource
private GradeUnitDOMapper gradeUnitDOMapper;
@Test
void test() {
String file = "C:\\project\\java\\enlish_edu\\enlish\\enlish-service\\src\\test\\java\\com\\yinlihupo\\enlish\\service\\mapper\\min.xlsx";
String file = "C:\\project\\java\\enlish_edu\\enlish\\enlish-service\\src\\test\\java\\com\\yinlihupo\\enlish\\service\\mapper\\3上.xlsx";
HashMap<String, Integer> map = new HashMap<>();
int gradeId = 3;
try (FileInputStream fis = new FileInputStream(file); Workbook workbook = new XSSFWorkbook(fis)) {
Sheet sheet = workbook.getSheetAt(0);
@@ -44,10 +48,14 @@ public class TestVocabularyBankInsert {
continue;
}
String gradeUnit = row.getCell(0).getStringCellValue();
String word = row.getCell(1).getStringCellValue();
String phonetic = row.getCell(2) != null ? row.getCell(2).getStringCellValue() : "";
String meaning = row.getCell(3) != null ? row.getCell(3).getStringCellValue() : "";
String word = row.getCell(0).getStringCellValue();
String meaning = row.getCell(1) != null ? row.getCell(1).getStringCellValue() : "";
String gradeUnit = row.getCell(2) != null ? row.getCell(2).getStringCellValue() : "";
if (word.contains("Unit")) {
continue;
}
int gradeUnitId = 0;
if (map.containsKey(gradeUnit)) {
@@ -61,6 +69,7 @@ public class TestVocabularyBankInsert {
.createAt(LocalDateTime.now())
.build();
unitDOMapper.insert(unitDO);
gradeUnitDOMapper.insert(GradeUnitDO.builder().unitId(unitDO.getId()).gradeId(gradeId).build());
gradeUnitId = unitDO.getId();
} else {
gradeUnitId = unitDO.getId();
@@ -71,7 +80,7 @@ public class TestVocabularyBankInsert {
VocabularyBankDO vocabularyBankDO = VocabularyBankDO.builder()
.word(word)
.definition(meaning)
.pronunciation(phonetic)
.pronunciation("")
.unitId(gradeUnitId)
.build();
vocabularyBankMapper.insertSelective(vocabularyBankDO);

View File

@@ -26,7 +26,7 @@ public class ExamTest {
private VocabularyService vocabularyService;
@Test
public void test() {
ExamWordsDO examWordsDO = examWordsService.generateExamWords(5, 0, List.of(1));
ExamWordsDO examWordsDO = examWordsService.generateExamWords(5, 0, 1, 0);
log.info("{}", examWordsDO);
List<VocabularyBankDO> vocabularyBankDOS = vocabularyService.findVocabularyBankDOListById(examWordsDO.getWordIds());
List<Word> assessmentWords = vocabularyBankDOS.stream().map(vocabularyBankDO -> Word.builder()