1
0

question.js 4.4 KB

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