package com.xhkjedu.sexam.mapper.paperstudent;

import com.xhkjedu.sexam.base.TkMapper;
import com.xhkjedu.sexam.model.paperstudent.EPaperStudent;
import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
import com.xhkjedu.sexam.vo.paperstudent.PsqAnswerVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.jmx.export.annotation.ManagedOperationParameter;
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);

    //学生作业未批改试题数量
    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> listPaperStudentQuestionByeptqid(@Param("epid")Integer epid, @Param("eptqids")List<Integer> eptqids);

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

    //修改缺考学生试卷试题批阅状态
    void updateStuQuestionChecked(@Param("epsid")Integer epsid,@Param("studentid")Integer studentid);

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

    //修改学生得分
    void updateStuScoreByepsqid(@Param("stuscore")Double stuscore,@Param("epsqid")Integer epsqid);

    //根据试题id获取考试信息
    EPaperStudentQuestion getExamPaperStudntQuestionbyEpsqid(@Param("epsqid")Integer epsqid);

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

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

}
