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

import java.util.List;

import cn.com.qmth.stmms.biz.exam.model.ExamQuestion;
import cn.com.qmth.stmms.biz.exam.service.query.ExamQuestionSearchQuery;

public interface ExamQuestionService {

    ExamQuestion save(ExamQuestion question);

    void deleteByExam(int examId);

    void deleteByExamAndSubject(int examId, String subjectCode);

    void deleteByExamAndSubjectAndObjective(int examId, String subjectCode, boolean objective);
    
    void deleteByExamIdAndSubjectCodeAndObjectiveAndMainNumber(int examId, String subjectCode, boolean objective,int mainNumber);

    ExamQuestion findOne(int examId, String subjectCode, boolean objective, int mainNumber, int subNumber);

    List<ExamQuestion> findByExamAndSubjectAndObjective(int examId, String subjectCode, boolean objective);

    List<ExamQuestion> findByExamAndSubjectAndObjectiveAndMainNumber(int examId, String subjectCode, boolean objective,
            int mainNumber);

    long countByExamAndSubject(int examId, String subjectCode);

    long countByExamAndSubjectAndObjective(int examId, String subjectCode, boolean objective);

    ExamQuestionSearchQuery findByQuery(ExamQuestionSearchQuery query);

    long countByQuery(ExamQuestionSearchQuery query);
    
    void batchSave(List<ExamQuestion> question);
    
    double scoreByExamIdAndSubjectCode(int examId, String subjectCode);
    
    double scoreByExamIdAndSubjectCodeAndObjective(int examId, String subjectCode,boolean objective);
    
    double scoreByExamIdAndSubjectCodeAndMainNumberAndObjective(int examId, String subjectCode,int mainNumber,boolean objective);

}
