question.js 4.8 KB

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