package com.xhkjedu.sexam.mapper.paper;

import com.xhkjedu.sexam.model.paperstudent.EPaperStudentQuestion;
import com.xhkjedu.sexam.vo.paper.EPaperSQuestionVo;
import com.xhkjedu.vo.exam.EPaperVo;
import org.apache.ibatis.annotations.Param;

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

public interface EPaperCorrectTeacherMapper {
    //待阅卷列表
    List<Map> listPending(@Param("teacherid") Integer teacherid);

    //已阅卷列表
    List<Map> listMarked(@Param("teacherid") Integer teacherid);

    //随机获取一条待批阅试题
    EPaperSQuestionVo getCorrectQuestion(@Param("teacherid") Integer teacherid
            , @Param("eptqid") Integer eptqid, @Param("classids") String classids
            , @Param("epsqid") Integer epsqid,@Param("checked") Integer checked);

    //试题批阅情况
    EPaperSQuestionVo getCheckQuestion(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid
            , @Param("classids") String classids);

    //修改试卷学生试题为批阅中
    void updateCheckQuestionById(@Param("epsqid") Integer epsqid, @Param("teacherid") Integer teacherid
            ,@Param("timestamp") int timestamp);

    //获取上一份批阅试题
    EPaperSQuestionVo getPreQuestion(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);

    //阅卷记录
    List<Map> listRecord(@Param("eptqid") Integer eptqid, @Param("teacherid") Integer teacherid);

    //获取批阅试题的状态
    Integer getCorrectQuestionState(@Param("epsqid") Integer epsqid);

    //批阅试题
    void correctQuestion(@Param("psq") EPaperStudentQuestion psq);

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

    //修改学生试卷批阅状态
    void updateCheckStuById(@Param("epsid") Integer epsid, @Param("checkid") Integer checkid);

    //根据考试科目id获取考试名称
    Map getExamNameByEsId(@Param("esid") Integer esid);

    //获取考试试卷
    List<EPaperVo> listPaperByExamId(@Param("examid") Integer examid);

    //获取考试学生试题
    List<EPaperStudentQuestion> listStuQuestionByEpids(@Param("epids") String epids);

    //获取试卷试题题号
    List<Map> listQnByEpId(@Param("epid") Integer epid);

    //获取已批阅试题
    EPaperSQuestionVo getCheckedQuestion(@Param("teacherid") Integer teacherid,@Param("epsqid") Integer epsqid);

    //随机获取一条待批阅试题
    EPaperSQuestionVo getCorrectQuestion2(@Param("teacherid") Integer teacherid, @Param("eptqids") List<Integer> eptqids
            , @Param("classids") String classids);

    //获取第一条批改试题
    EPaperSQuestionVo getCheckedQuestion2(@Param("eptqids") List<Integer> eptqids, @Param("teacherid") Integer teacherid);

    //取消试题锁定
    void unLockAllQuestion(@Param("teacherid") Integer teacherid);

    //试题锁定状态超过30分钟后自动取消
    void unLockQuestion(@Param("timestamp") int timestamp);

    //试卷批阅进度
    EPaperSQuestionVo getPaperCheck(@Param("psq") EPaperStudentQuestion psq);

    EPaperSQuestionVo getCorrectQuestion3(Integer teacherid, Integer eptqid, String classids, Integer epsqid);

    //获取待阅卷数量
    Integer getPendingNum(@Param("teacherid") Integer teacherid);
}