question.js 5.2 KB

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