ScoreCounter.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include "DataBaseHolder.h"
  3. #include <vector>
  4. using namespace std;
  5. struct q_std{
  6. #define MAX_OPTION 10
  7. string question_code;
  8. int question_type;
  9. int mutil_answer;
  10. int rule_type;
  11. string answer_std;
  12. vector<string> answer_std_option;
  13. int option_count;
  14. float score_full;
  15. float score_half;
  16. bool is_case_score;
  17. map<string,float> case_score;
  18. string answer_all;
  19. };
  20. /************************************************************************/
  21. /* 分数统计类 */
  22. /************************************************************************/
  23. class CScoreCounter:public CDataBaseHolder
  24. {
  25. public:
  26. CScoreCounter(void);
  27. ~CScoreCounter(void);
  28. public:
  29. virtual void Load();
  30. float GetScore(const std::string &question_code,const std::string& answer ,const int isright,const float score);
  31. float GetScore_TianKongTi2(const std::string &question_code, const float score);
  32. float GetScore( q_std&question_std, const string & answer, float result, int isright, float score );
  33. q_std get_std(const std::string &question_code);
  34. private:
  35. std::map<std::string,q_std> q_stdm;
  36. };
  37. // 客观题异常防止同一套试题多次被加载
  38. class CScoreCounterEx : public CScoreCounter
  39. {
  40. public:
  41. CScoreCounterEx(void);
  42. ~CScoreCounterEx(void);
  43. public:
  44. virtual void Load();
  45. private:
  46. bool m_bload;
  47. };