1
0

question.js 5.0 KB

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