feat(exam): 支持按单个学生和考试类型生成考试试题
- 修改生成试题按钮仅在选中特定一个学生时可用,避免多选时误操作 - 在考试生成对话框新增“类型”选择项,支持“摸底”和“期中|期末”类型 - 调整后台接口,使用单个学生ID和考试类型替代学生ID列表参数 - 优化考试生成服务,新增摸底考试生成逻辑,按年级分区随机抽词汇 - 考试相关数据对象新增类型字段,保持数据完整性和一致性 - 修改考试判卷服务,将错误信息字段统一为msg,避免字段混淆 - 调整数据库操作,支持单个学生考试与词汇随机获取 - 同步更新测试用例和词汇库数据插入逻辑,确保环境一致性 - 修复界面生成按钮状态和对话框提交按钮的校验逻辑,提升用户体验
This commit is contained in:
@@ -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" />
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user