package cn.hmsoft.ltc.service.iface;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import cn.hmsoft.ltc.model.QuestionType;
import cn.hmsoft.ltc.model.Subject;
import javafx.collections.ObservableList;

/**
 * 题目管理 service 接口
 * 
 * @author xuwenjin
 * @date 2019-03-27
 *
 */
public interface SubjectService {
	/**
	 * 新增题目信息
	 * 
	 * @param user
	 */
	Integer insertSubject(Subject subject) throws SQLException;

	/**
	 * 删除题目信息
	 * 
	 * @param user
	 */
	void deleteSubject(Subject subject) throws SQLException;

	/**
	 * 修改题目信息
	 * 
	 * @param user
	 */
	void updateSubject(Subject subject) throws SQLException;

	/**
	 * 修改小题分标志位.
	 * @param paperNo
	 * @param typeId
	 */
	void updateSubjectTinyScoreFlag(String paperNo, Integer typeId);
	
	int findSubjectScoreCount(String paperNo, Integer typeId) throws SQLException;
	
	Map<Integer, QuestionType> getQuestionTypeMap();
	/**
	 * 查询题目信息
	 * 
	 * @return
	 * @throws SQLException
	 */
	ObservableList<Subject> selectSubject(Subject subject) throws SQLException;

	List<Subject> findSubjectList(String testPaperId, Integer typeId) throws SQLException;
	
	void deleteSubjectByPageNo(String testPaperId, Integer typeId) throws SQLException;

	Map<String, Integer> findSubjectChapterDist(String paperNo) throws SQLException;
	
	/**
	 * 查询题目预估难度信息
	 * 
	 * @return
	 * @throws SQLException
	 */
	ObservableList<Subject> selectEstimatedDifficulty(Subject subject) throws SQLException;
}
