package com.ynfy.buss.exam.paper.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ynfy.buss.exam.paper.dto.PaperDTO;
import com.ynfy.buss.exam.paper.entity.Paper;
import com.ynfy.buss.exam.paperquestion.entity.PaperQuestion;
import com.ynfy.buss.exam.paperquestionanswer.entity.PaperQuestionAnswer;
import com.ynfy.buss.exam.paperrulegroup.entity.PaperRuleGroup;
import com.ynfy.buss.exam.question.entity.Question;

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

/**
 * @Description: paper
 * @Author: jeecg-boot
 * @Date: 2023-02-22
 * @Version: V1.0
 */
public interface IPaperService extends IService<Paper> {



    void save(PaperDTO paperDTO);

    /**
     * 生成试卷试题
     *
     * @param paperId
     */
    List<PaperQuestion> generateQuestion(String paperId);

    /**
     * 查看试卷明细
     *
     * @param paperId
     */
    PaperDTO detail(String paperId);

    /**
     * 删除试卷 试题 规则
     *
     * @param paperId
     */
    void remove(String paperId);


    void removeBatch(String ids);


    /**
     * 随机组卷抽取部分试题
     *
     * @return
     */
    List<Question> extractPartQuestion(String ruleDetail, String questionIds);


    /**
     * 组装试卷试题，子题目，答案
     *
     * @param paperQuestionList
     * @param answerMap
     * @param g
     * @return
     */
    List<Question> assemblePaperQuestion(String paperId, List<PaperQuestion> paperQuestionList,
                                         Map<String, PaperQuestionAnswer> answerMap, PaperRuleGroup g);
}
