question.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. import BaseStore from '@src/stores/base';
  2. export default class QuestionStore extends BaseStore {
  3. /**
  4. * 练习进度
  5. * @param {*} structId
  6. */
  7. getExerciseProgress(structId) {
  8. return this.apiGet('/question/exercise/progress', { structId });
  9. }
  10. /**
  11. * 查询第4层考点信息
  12. * @param {*} structId
  13. */
  14. getExercisePlace(structId) {
  15. return this.apiGet('/question/exercise/place', { structId });
  16. }
  17. /**
  18. * 练习组卷
  19. * @param {*} page
  20. * @param {*} size
  21. * @param {*} structId
  22. * @param {*} logic
  23. * @param {*} logicExtend
  24. * @param {*} finish: true完成,false未完成
  25. */
  26. getExerciseList(page, size, structId, logic, logicExtend, finish) {
  27. return this.apiGet('/question/exercise/list', { page, size, structId, logic, logicExtend, times: finish ? 1 : null });
  28. }
  29. /**
  30. * 模考进度
  31. * @param {*} page
  32. * @param {*} size
  33. */
  34. getExaminationProgress(page, size) {
  35. return this.apiGet('/question/examination/progress', { page, size });
  36. }
  37. /**
  38. * 模考组卷
  39. * @param {*} page
  40. * @param {*} size
  41. */
  42. getExaminationList(page, size) {
  43. return this.apiGet('/question/examination/list', { page, size });
  44. }
  45. /**
  46. * 通过题目Id获取详情
  47. * @param {*} userQuestionId
  48. */
  49. getDetailById(userQuestionId) {
  50. return this.apiGet('/question/detail', { userQuestionId });
  51. }
  52. /**
  53. * 通过记录及序号获取详情
  54. * @param {*} userReportId
  55. * @param {*} no
  56. */
  57. getDetailByNo(userReportId, no) {
  58. return this.apiGet('/question/detail', { userReportId, no });
  59. }
  60. /**
  61. * 获取练习卷
  62. * @param {*} paperId
  63. */
  64. getExercisePaper(paperId) {
  65. return this.apiGet('/question/exercise/paper', { paperId });
  66. }
  67. /**
  68. * 获取模考卷
  69. * @param {*} paperId
  70. */
  71. getExaminationPaper(paperId) {
  72. return this.apiGet('/question/examination/paper', { paperId });
  73. }
  74. /**
  75. * 获取错题组卷
  76. * @param {*} paperId
  77. */
  78. getErrorPaper(paperId) {
  79. return this.apiGet('/question/error/paper', { paperId });
  80. }
  81. /**
  82. * 获取收藏组卷
  83. * @param {*} paperId
  84. */
  85. getCollectPaper(paperId) {
  86. return this.apiGet('/quesiton/collect/paper', { paperId });
  87. }
  88. /**
  89. * 获取组卷
  90. * @param {*} type
  91. * @param {*} paperId
  92. */
  93. getPaper(type, paperId) {
  94. return this.apiGet(`/question/${type}/paper`, { paperId });
  95. }
  96. /**
  97. * 获取做题记录
  98. * @param {*} userReportId
  99. */
  100. baseReport(userReportId) {
  101. return this.apiGet('/question/report/base', { userReportId });
  102. }
  103. /**
  104. * 获取做题详细记录
  105. * @param {*} userReportId
  106. */
  107. detailReport(userReportId) {
  108. return this.apiGet('/question/report/detail', { userReportId });
  109. }
  110. /**
  111. * 开始考试
  112. * @param {*} type
  113. * @param {*} paperId
  114. * @param {*} disorder
  115. * @param {*} order: 模考
  116. */
  117. start(type, paperId, disorder, order) {
  118. return this.apiPost(`/question/${type}/start`, { paperId, disorder, order });
  119. }
  120. /**
  121. * 下一题
  122. * @param {*} userReportId
  123. */
  124. next(userReportId) {
  125. return this.apiPost('/question/next', { userReportId });
  126. }
  127. /**
  128. * 提交题目答案
  129. * @param {*} userQuestionId
  130. * @param {*} answer
  131. * @param {*} time
  132. * @param {*} setting
  133. */
  134. submit(userQuestionId, answer, time, setting) {
  135. return this.apiPost('/question/submit', { userQuestionId, answer, time, setting });
  136. }
  137. /**
  138. * 完成考试
  139. * @param {*} userReportId
  140. */
  141. finish(userReportId) {
  142. return this.apiPost('/question/finish', { userReportId });
  143. }
  144. /**
  145. * 继续考试
  146. * @param {*} userPaperId
  147. */
  148. continue(userPaperId) {
  149. return this.apiPost('/question/continue', { userPaperId });
  150. }
  151. /**
  152. * 模考:下一阶段
  153. * @param {*} userPaperId
  154. */
  155. stage(userPaperId) {
  156. return this.apiPost('/question/stage', { userPaperId });
  157. }
  158. /**
  159. * 重置考试
  160. * @param {*} userPaperId
  161. */
  162. restart(userPaperId) {
  163. return this.apiPost('/question/restart', { userPaperId });
  164. }
  165. /**
  166. * 重置整套模考卷
  167. * @param {*} structId
  168. */
  169. restartExamination(structId) {
  170. return this.apiPost('/question/restart/examination', { structId });
  171. }
  172. }
  173. export const Question = new QuestionStore({ key: 'question' });