feat(exam): 实现考试阶段单词判卷与学生水平智能诊断

- 新增ActionType枚举定义系统动作类型
- 新增DiagnosisResult和ZoneStats数据模型支持诊断结果及区域统计
- 优化ExamWordsJudgeServiceImpl判卷逻辑,支持识别图片、更新考试判卷结果
- 基于分区词汇掌握情况,实现学生当前水平年级的智能判定
- 实现基于多分区准确率的升级、降级、复习和触发重测等动作建议
- 更新学生实际年级actualGradeId并展示在学生详情页面
- 修正ExamWordsConstant年级常量及年级名称映射方法
- 优化前端生成试题对年级和难度的校验逻辑,简化参数传递
- 修改服务端端口及API代理配置,保持一致性
- 调整相关数据库Mapper,支持批量查询和更新实际年级字段
- 修改错误信息字段命名,统一为msg
- 增删改代码注释与日志,提升容错性和可读性
This commit is contained in:
lbw
2025-12-22 14:11:11 +08:00
parent 065da854ee
commit 515bd8fae2
24 changed files with 381 additions and 116 deletions

View File

@@ -1,5 +1,5 @@
server:
port: 8080 # 项目启动的端口
port: 8081 # 项目启动的端口
spring:
profiles:

View File

@@ -12,7 +12,6 @@
<result column="is_finished" jdbcType="INTEGER" property="isFinished" />
<result column="start_date" jdbcType="TIMESTAMP" property="startDate" />
<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">
@@ -34,8 +33,8 @@
<update id="updateMsg">
update exam_words_judge_result
set msg = #{msg}
and is_finished = 2
set msg = #{msg},
is_finished = 2
where id = #{id}
</update>
@@ -47,7 +46,8 @@
wrong_word_ids = #{examWordsJudgeResultDO.wrongWordIds, typeHandler=com.yinlihupo.enlish.service.config.ListWordIdTypeHandler},
correct_word_count = #{examWordsJudgeResultDO.correctWordCount},
wrong_word_count = #{examWordsJudgeResultDO.wrongWordCount},
is_finished = 1
is_finished = 1,
msg = #{examWordsJudgeResultDO.msg}
where id = #{examWordsJudgeResultDO.id}
</update>

View File

@@ -19,6 +19,17 @@
where unit_id = #{unitId}
</select>
<select id="selectByUnitIds" resultMap="BaseResultMap">
select *
from grade_unit
<if test="unitIds != null">
where unit_id in
<foreach collection="unitIds" item="unitId" separator="," open="(" close=")">
#{unitId}
</foreach>
</if>
</select>
<insert id="insert">
insert into grade_unit (grade_id, unit_id)
values (#{gradeId}, #{unitId})

View File

@@ -10,6 +10,7 @@
<result column="current_vocabulary_size" jdbcType="INTEGER" property="currentVocabularySize" />
<result column="is_deleted" jdbcType="INTEGER" property="isDeleted"/>
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
<result column="actual_grade_id" jdbcType="INTEGER" property="actualGradeId" />
</resultMap>
<select id="selectStudentDOListByClassIdAndGradeId" resultMap="BaseResultMap">
@@ -52,8 +53,8 @@
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
insert into student
(name, class_id, grade_id, is_deleted, start_time)
values (#{name}, #{classId}, #{gradeId}, 0, #{startTime})
(name, class_id, grade_id, is_deleted, start_time, actual_grade_id)
values (#{name}, #{classId}, #{gradeId}, 0, #{startTime}, #{actualGradeId})
</insert>
<update id="deleteById">
@@ -62,6 +63,12 @@
where id = #{id}
</update>
<update id="updateStudentActualGradeId">
update student
set actual_grade_id = #{gradeId}
where id = #{studentId}
</update>
<select id="selectStudentCountByClassId" resultType="java.lang.Integer">
select count(1)
from student

View File

@@ -117,6 +117,7 @@
</if>
limit #{wordCount}
</select>
<select id="selectWordTotal" resultType="java.lang.Integer">
select count(*)
from vocabulary_bank