【修改】增加后台api接口注释,优化mysql判分,知识点改为存储id,试题已使用,学生除待考其它状态不可删除。。。

【新增】试卷任务参数,在已有的试卷里抽卷。。。
This commit is contained in:
YOHO\20373
2025-06-09 10:51:13 +08:00
parent d34b189598
commit a100427181
45 changed files with 1027 additions and 203 deletions

View File

@@ -19,7 +19,7 @@
<result property="examTime" column="exam_time" />
<result property="directory" column="directory" />
<result property="uploadTime" column="upload_time" />
<result property="isDel" column="is_del" />
<result property="isCopy" column="is_copy" />
<result property="isRepeat" column="is_repeat" />
<result property="isAnswer" column="is_answer" />
<result property="isLook" column="is_look" />
@@ -29,12 +29,14 @@
<result property="isFile" column="is_file" />
<result property="isNet" column="is_net" />
<result property="isScreen" column="is_screen" />
<result property="isScore" column="is_score" />
<result property="isScoreDetail" column="is_score_detail" />
</resultMap>
<sql id="selectEducationPaperParamVo">
select param_id, task_id, is_number,is_content,is_answer_id,is_exam_password, exam_password, usb, save_grades, driver, directory, upload_time, is_time,exam_time,is_del,is_repeat ,is_answer,is_look,is_connect,is_session,warn,is_file,is_net,is_screen from education_paper_param
select param_id, task_id, is_number,is_content,is_answer_id,is_exam_password, exam_password, usb, save_grades, driver, directory, upload_time,
is_time,exam_time,is_copy,is_repeat ,is_answer,is_look,is_connect,is_session,warn,is_file,is_net,is_screen,is_score,is_score_detail from education_paper_param
</sql>
<select id="selectEducationPaperParamList" parameterType="EducationPaperParam" resultMap="EducationPaperParamResult">
@@ -48,7 +50,6 @@
<if test="driver != null and driver != ''"> and driver = #{driver}</if>
<if test="directory != null and directory != ''"> and directory = #{directory}</if>
<if test="uploadTime != null and uploadTime != ''"> and upload_time = #{uploadTime}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
@@ -78,7 +79,7 @@
<if test="uploadTime != null">upload_time,</if>
<if test="isTime != null">is_time,</if>
<if test="examTime != null">exam_time,</if>
<if test="isDel != null">is_del,</if>
<if test="isCopy != null">is_copy,</if>
<if test="isRepeat != null">is_repeat,</if>
<if test="isAnswer != null">is_answer,</if>
<if test="isLook != null">is_look,</if>
@@ -88,6 +89,10 @@
<if test="isFile != null">is_file,</if>
<if test="isNet != null">is_net,</if>
<if test="isScreen != null">is_screen,</if>
<if test="isScore != null">is_score,</if>
<if test="isScoreDetail != null">is_score_detail,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="paramId != null">#{paramId},</if>
@@ -104,7 +109,7 @@
<if test="uploadTime != null">#{uploadTime},</if>
<if test="isTime != null">#{isTime},</if>
<if test="examTime != null">#{examTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="isCopy != null">#{isCopy},</if>
<if test="isRepeat != null">#{isRepeat},</if>
<if test="isAnswer != null">#{isAnswer},</if>
<if test="isLook != null">#{isLook},</if>
@@ -114,6 +119,8 @@
<if test="isFile != null">#{isFile},</if>
<if test="isNet != null">#{isNet},</if>
<if test="isScreen != null">#{isScreen},</if>
<if test="isScore != null">#{isScore},</if>
<if test="isScoreDetail != null">#{isScoreDetail},</if>
</trim>
</insert>
@@ -133,7 +140,7 @@
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
<if test="isTime != null">is_time = #{isTime},</if>
<if test="examTime != null">exam_time = #{examTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="isCopy != null">is_copy = #{isCopy},</if>
<if test="isRepeat != null">is_repeat = #{isRepeat},</if>
<if test="isAnswer != null">is_answer = #{isAnswer},</if>
<if test="isLook != null">is_look = #{isLook},</if>
@@ -143,6 +150,8 @@
<if test="isFile != null">is_file = #{isFile},</if>
<if test="isNet != null">is_net = #{isNet},</if>
<if test="isScreen != null">is_screen = #{isScreen},</if>
<if test="isScore != null">is_score = #{isScore},</if>
<if test="isScoreDetail != null">is_score_detail = #{isScoreDetail},</if>
</trim>
where param_id = #{paramId}

View File

@@ -39,6 +39,22 @@
(select qu_id from education_paper_qu where paper_id =#{paperId})ORDER BY RAND()
LIMIT 1;
</select>
<select id="selectUsedQuestionIds" resultType="java.lang.String">
SELECT DISTINCT qu_id
FROM education_paper_qu
WHERE qu_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectByPaperIdAndType" resultType="java.lang.String">
SELECT epq.qu_id
FROM education_paper_qu epq
JOIN exam_question eq ON epq.qu_id = eq.qu_id
WHERE epq.paper_id = #{paperId}
AND eq.subject_name = #{spName}
</select>
<insert id="insertEducationPaperQu" parameterType="EducationPaperQu">

View File

@@ -44,6 +44,9 @@
<select id="selectEducationPaperTaskByTaskId" resultMap="EducationPaperSchemeResult">
select * from education_paper_scheme where task_id =#{taskid} order by sort asc
</select>
<select id="selectEducationPaperSchemeCountsByTaskId" resultType="java.lang.Integer">
select count(*) from education_paper_scheme where task_id =#{taskId}
</select>
<insert id="insertEducationPaperScheme" parameterType="EducationPaperScheme">
insert into education_paper_scheme

View File

@@ -95,6 +95,14 @@
<select id="selectAnswerFile" resultType="java.lang.String">
select url from sys_file where qu_id =#{quId} and file_type ='2'
</select>
<select id="selectCountPointByQuId" resultType="java.lang.String">
SELECT SUM(score_rate) AS totalKeyScore
FROM exam_question_answer
WHERE qu_id =#{quId};
</select>
<select id="selectExamQuestionAnswerScoreByAnswerId" resultType="java.lang.String">
select score_rate from exam_question_answer where answer_id =#{answerId}
</select>
<insert id="insertExamQuestionAnswerList">
insert into exam_question_answer
(answer_id, qu_id, is_right, image, content,contentIn,score_rate,sort)

View File

@@ -44,6 +44,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and deleted = 0
</where>
</select>
<select id="selectKnowledgeNameBySpId" resultType="java.lang.String">
select sp_name from exam_knowledge_points where sp_id =#{spId}
</select>
<select id="selectKnowledgePoints" resultMap="KnowledgePointsResult">
select sp_id ,sp_name from exam_knowledge_points where deleted = 0
</select>
<update id="deleteKnowledgePointsBySpId" parameterType="Long">
update exam_knowledge_points

View File

@@ -15,4 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectByStuIdAndTaskId" resultType="java.lang.String">
select task_id from exam_monitor where stu_id = #{stuId} and exam_status !='2'
</select>
<select id="selectStuIdByTaskId" resultType="java.lang.String">
select stu_id from exam_monitor where task_id =#{taskId} and deleted ='0' and exam_status ='0'
</select>
</mapper>