question.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. import BaseStore from '@src/stores/base';
  2. export default class QuestionStore extends BaseStore {
  3. /**
  4. * 练习进度
  5. * @param {*} structId
  6. */
  7. getExerciseProcess(structId) {
  8. return this.apiGet('/question/exercise/process', { 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. getExaminationProcess(page, size) {
  35. return this.apiGet('/question/examination/process', { 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 {*} type
  99. * @param {*} paperId
  100. * @param {*} disorder
  101. * @param {*} order: 模考
  102. */
  103. start(type, paperId, disorder, order) {
  104. return this.apiPost(`/question/${type}/start`, { paperId, disorder, order });
  105. }
  106. /**
  107. * 下一题
  108. * @param {*} userReportId
  109. */
  110. next(userReportId) {
  111. return this.apiPost('/question/next', { userReportId });
  112. }
  113. /**
  114. * 提交题目答案
  115. * @param {*} userQuestionId
  116. * @param {*} answer
  117. * @param {*} time
  118. * @param {*} setting
  119. */
  120. submit(userQuestionId, answer, time, setting) {
  121. return this.apiPost('/question/submit', { userQuestionId, answer, time, setting });
  122. }
  123. /**
  124. * 完成考试
  125. * @param {*} userReportId
  126. */
  127. finish(userReportId) {
  128. return this.apiPost('/question/finish', { userReportId });
  129. }
  130. /**
  131. * 继续考试
  132. * @param {*} userPaperId
  133. */
  134. continue(userPaperId) {
  135. return this.apiPost('/question/continue', { userPaperId });
  136. }
  137. /**
  138. * 模考:下一阶段
  139. * @param {*} userPaperId
  140. */
  141. stage(userPaperId) {
  142. return this.apiPost('/question/stage', { userPaperId });
  143. }
  144. /**
  145. * 重置考试
  146. * @param {*} userPaperId
  147. */
  148. restart(userPaperId) {
  149. return this.apiPost('/question/restart', { userPaperId });
  150. }
  151. /**
  152. * 重置整套模考卷
  153. * @param {*} structId
  154. */
  155. restartExamination(structId) {
  156. return this.apiPost('/question/restart/examination', { structId });
  157. }
  158. }
  159. export const Question = new QuestionStore({ key: 'question' });