package com.qmth.jkserver.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.jkserver.dto.FileDto;
import com.qmth.jkserver.model.Attachment;
import com.qmth.jkserver.model.ExamPaperTemp;
import com.qmth.jkserver.model.ExamPaperUncoiling;
import com.qmth.jkserver.model.ExamStudentAnswer;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @Description: 试卷临时service
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/5/12
 */
public interface ExamPaperTempService extends IService<ExamPaperTemp> {

    /**
     * 查询所有考试科目
     *
     * @param examCode
     * @return
     */
    public List<ExamPaperTemp> findExamCourseAllByTask(String examCode);

    /**
     * 获取试卷答案json文件
     *
     * @param examCode
     * @return
     */
    public FileDto getPaperAnswerJsonFile(String examCode) throws Exception;

    /**
     * 解析zip文件
     *
     * @param target
     * @param examPaperUncoilingList
     * @param mapFile
     * @param deletePaths
     * @return
     * @throws Exception
     */
    public Map<String, File> analyzePaperZip(File target, List<ExamPaperUncoiling> examPaperUncoilingList, Map<String, File> mapFile, List<String> deletePaths) throws Exception;

    /**
     * 获取考生作答json文件
     *
     * @param examCode
     * @param examStudentAnswerList
     * @param attachmentMap
     * @return
     */
    public FileDto getExamStudentAnswerJsonFile(String examCode, List<ExamStudentAnswer> examStudentAnswerList,Map<Long, Attachment> attachmentMap) throws IOException;
}
