package cn.com.qmth.stmms.biz.exam.service;

import java.util.List;

import cn.com.qmth.stmms.biz.exam.model.ObjectiveBlock;
import cn.com.qmth.stmms.biz.exam.model.ObjectiveQuestion;
import cn.com.qmth.stmms.biz.exam.query.ObjectiveBlockSearchQuery;

public interface ObjectiveBlockService {

    ObjectiveBlock saveBlock(ObjectiveBlock objectiveBlock);

    /**
     * 根据考试ID，学科CODE，文理科统计客观大题的数量
     * 
     * @param examId
     * @param subjectCode
     * @return
     */
    long countBlockByExamIdAndSubjectCode(int examId, String subjectCode);

    /**
     * 统计某次考试已设置的科目数量，按subjectId和classType分组
     * 
     * @param examId
     * @return
     */
    public long countSubjectByExamId(int examId);

    /**
     * 根据考试ID、学科CODE查询客观题块
     * 
     * @param examId
     * @param subjectCode
     * @return
     */
    List<ObjectiveBlock> findBlockByExamIdAndSubjectCode(int examId, String subjectCode);

    /**
     * 根据考试ID、学科CODE删除客观题块
     * 
     * @param examId
     * @param subjectCode
     */
    void deleteBlockByExamIdAndSubjectCode(int examId, String subjectCode);

    void deleteBlock(ObjectiveBlock objectiveBlock);

    List<ObjectiveBlock> findBlockByExamId(int examId);

    List<ObjectiveBlock> findBlockByExamIdAndSubjectCode(int examId, String subjectCode, boolean withQuestion);

    ObjectiveBlockSearchQuery findByQuery(ObjectiveBlockSearchQuery query);

    public List<ObjectiveQuestion> findQuestionByBlockId(int blockId);

    ObjectiveBlock findBlockByExamIdAndSubjectCodeAndNumber(int examId, String subjectCode, int number);

    ObjectiveBlock findBlockById(int blockId, boolean withQuestion);

}
