package com.xhkjedu.sexam.mapper.paperstudent;

import com.xhkjedu.base.TkMapper;
import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
import com.xhkjedu.sexam.vo.paperstudent.PsqAnswerVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Description 学生试卷试题
 * @Author WN
 * Date 2022/7/27 15:07
 **/
@Repository
public interface EPaperStudentQuestionMapper extends TkMapper<EPaperStudentQuestion> {

    //根据学生试题id获取试题正确答案
    PsqAnswerVo getPaperQuestionAnswer(@Param("epsqid")Integer epsqid);

    //提交单题
    void updateStuAnswer(@Param("q")EPaperStudentQuestion q);

    //处理学生未提交试题
    void updateStuQuesitonNoCommit(@Param("epsid") Integer epsid,@Param("timestamp") int timestamp);

    //学生作业未批改试题数量
    Integer getStuQuestionNoCheckNum(@Param("epsid")Integer epsid);

    //获取试卷中未合并图片
    List<EPaperStudentQuestion> listStuQuesitonStuAnswerPic(@Param("epsid")Integer epsid);

    //获取试卷中所有试题正确答案及分值
    List<PsqAnswerVo> listPaperQuestionsAnswer(@Param("epsid")Integer epsid);

    //批量提交试题
    void updateBatchStuQuestion(@Param("list")List<EPaperStudentQuestion> list);

    //获取试卷中指定试题作答情况
    List<EPaperStudentQuestion> listPaperStudentQuestionsByeptqid(@Param("epid")Integer epid, @Param("eptqid")Integer eptqid,@Param("limitnum")Integer limitnum);

    //批量修改学生试题需要批改状态
    void updateBatchStuQuesNeeddeal(@Param("epid")Integer epid,@Param("eptqids") List<Integer> eptqids);

    //批量修改学生试题分值
    void updateBatchStuQuestionScore(@Param("list")List<EPaperStudentQuestion> list);

    //报告生成-学生试卷
    List<EPaperStudentQuestion> listExamStudentsAnswer(@Param("examid")Integer examid);

    //学生作答得分试卷-题库
    List<Map> listQStuQuestionScore(@Param("epsid")Integer epsid);

    //学生作答得分试卷-附件
    List<Map> listFjStuQuestionScore(@Param("epsid")Integer epsid);

    //根据学生试卷id获取学生作答内容
    List<EPaperStudentQuestion> listStuQuestionsByEpsid(@Param("epsid")Integer epsid);

    //获取试卷中未合并图片
    List<EPaperStudentQuestion> listNoMergeUserAnswer();

    //获取未合并图片考试模式列表
    List<Map> listExamByIds(@Param("examids") List<Integer> examids);

    //获取学生试题列表
    List<EPaperStudentQuestion> listQuestionByStu(@Param("studentid") Integer studentid,@Param("eptqids") List<Integer> eptqids);

    //批量更新学生试题得分
    void updateBatchStuQuestionSore(@Param("list") List<EPaperStudentQuestion> questions);
}
