paperDef.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #ifndef PAPERDEF_H
  2. #define PAPERDEF_H
  3. #include <string>
  4. #include <vector>
  5. #include "json/json.h"
  6. #include <QString>
  7. extern int g_ItemOrderIndex;
  8. QString Arab2Sinogram(int num);
  9. enum STRUCT_TYPE
  10. {
  11. stSingleChoice = 1, //单选
  12. stMultiChoice, //多选
  13. stJudge, //判断
  14. stFillBlank, //填空
  15. stQuestionAndAnswer, //问答
  16. stSubjectSet, //套题
  17. };
  18. struct SUBQUESTION_INFO
  19. {
  20. std::string sId;
  21. int nOrderIndex;
  22. int nDetailNumber;
  23. int nQuestionNumber;
  24. int nNumber;
  25. double fScore;
  26. int nStructType;
  27. bool bObjective;
  28. Json::Value jBody;
  29. std::string sOptionOrders;
  30. Json::Value jOptions;
  31. Json::Value jStandarddAnswer;
  32. QString sAnswer;
  33. int nAnswerDuration;
  34. SUBQUESTION_INFO()
  35. {
  36. sId = "";
  37. nOrderIndex = 0;
  38. nDetailNumber = 0;
  39. nQuestionNumber = 0;
  40. nNumber = 0;
  41. fScore = 0;
  42. nStructType = 0;
  43. bObjective = false;
  44. jBody = Json::Value::null;
  45. sOptionOrders = "";
  46. jOptions = Json::Value::null;
  47. jStandarddAnswer = Json::Value::null;
  48. sAnswer = "";
  49. nAnswerDuration = 0;
  50. }
  51. };
  52. struct QUESTION_INFO
  53. {
  54. std::string sId;
  55. int nOrderIndex;
  56. int nDetailNumber;
  57. int nNumber;
  58. double fScore;
  59. int nStructType;
  60. bool bObjective;
  61. Json::Value jBody;
  62. std::string sOptionOrders;
  63. Json::Value jOptions;
  64. Json::Value jStandarddAnswer;
  65. QString sAnswer;
  66. int nAnswerDuration;
  67. std::vector<SUBQUESTION_INFO> vSubQuestions;
  68. QUESTION_INFO()
  69. {
  70. sId = "";
  71. nOrderIndex = 0;
  72. nDetailNumber = 0;
  73. nNumber = 0;
  74. fScore = 0;
  75. nStructType = 0;
  76. bObjective = false;
  77. jBody = Json::Value::null;
  78. sOptionOrders = "";
  79. jOptions = Json::Value::null;
  80. jStandarddAnswer = Json::Value::null;
  81. sAnswer = "";
  82. nAnswerDuration = 0;
  83. vSubQuestions.clear();
  84. }
  85. };
  86. enum QUESTION_SHOW_LEVEL
  87. {
  88. qslShowQuestion = 2,
  89. qslShowSubQuestion,
  90. };
  91. struct QUESTION_SHOW_INFO
  92. {
  93. int nLevel; //2 3
  94. int nDettailNumber;
  95. int nStartIndex;
  96. std::string sDetailName;
  97. QUESTION_INFO vQi;
  98. SUBQUESTION_INFO vSQI;
  99. // boost::variant<QUESTION_INFO, SUBQUESTION_INFO> vItem;
  100. QUESTION_SHOW_INFO()
  101. {
  102. nDettailNumber = 0;
  103. nLevel = 0;
  104. sDetailName = "";
  105. }
  106. };
  107. struct DEATIL_INFO
  108. {
  109. int nNumber;
  110. std::string sName;
  111. double fTotalScore;
  112. int nQueStionCount;
  113. std::vector<QUESTION_INFO> vQuestions;
  114. DEATIL_INFO()
  115. {
  116. nNumber = 0;
  117. sName = "";
  118. fTotalScore = 0;
  119. nQueStionCount = 0;
  120. vQuestions.clear();
  121. }
  122. };
  123. struct PAPER_INFO
  124. {
  125. std::string sId;
  126. std::string sName;
  127. std::string sCourseCode;
  128. std::string sCourseName;
  129. double fTotalScore;
  130. int nHasVideo;
  131. int nDetailCount;
  132. std::vector<DEATIL_INFO> vDetails;
  133. PAPER_INFO()
  134. {
  135. sId = "";
  136. sName = "";
  137. sCourseCode = "";
  138. sCourseName = "";
  139. fTotalScore = 0;
  140. nHasVideo = 0;
  141. nDetailCount = 0;
  142. vDetails.clear();
  143. }
  144. };
  145. #endif // PAPERDEF_H