question.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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 {*} questionNoId
  22. */
  23. getInfoById(questionNoId) {
  24. return this.apiGet('/question/info', { questionNoId });
  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. * @param {*} stage
  85. */
  86. getDetailByNo(userReportId, no, stage) {
  87. return this.apiGet('/question/base', { userReportId, no, stage });
  88. }
  89. /**
  90. * 获取练习卷
  91. * @param {*} paperId
  92. */
  93. getExercisePaper(paperId) {
  94. return this.apiGet('/question/exercise/paper', { paperId });
  95. }
  96. /**
  97. * 获取模考卷
  98. * @param {*} paperId
  99. */
  100. getExaminationPaper(paperId) {
  101. return this.apiGet('/question/examination/paper', { paperId });
  102. }
  103. /**
  104. * 获取错题组卷
  105. * @param {*} paperId
  106. */
  107. getErrorPaper(paperId) {
  108. return this.apiGet('/question/error/paper', { paperId });
  109. }
  110. /**
  111. * 获取收藏组卷
  112. * @param {*} paperId
  113. */
  114. getCollectPaper(paperId) {
  115. return this.apiGet('/quesiton/collect/paper', { paperId });
  116. }
  117. /**
  118. * 获取组卷
  119. * @param {*} type
  120. * @param {*} paperId
  121. */
  122. getPaper(type, paperId) {
  123. return this.apiGet(`/question/${type}/paper`, { paperId });
  124. }
  125. /**
  126. * 获取做题记录
  127. * @param {*} userReportId
  128. */
  129. baseReport(userReportId) {
  130. return this.apiGet('/question/report/base', { userReportId });
  131. }
  132. /**
  133. * 获取做题详细记录
  134. * @param {*} userReportId
  135. */
  136. detailReport(userReportId) {
  137. return this.apiGet('/question/report/detail', { userReportId });
  138. }
  139. /**
  140. * 获取做题题目记录
  141. * @param {*} userReportId
  142. */
  143. questionReport(userReportId) {
  144. return this.apiGet('/question/report/question', { userReportId });
  145. }
  146. /**
  147. * 开始考试
  148. * @param {*} type
  149. * @param {*} paperId
  150. * @param {*} disorder
  151. * @param {*} order: 模考
  152. */
  153. start(type, paperId, { disorder, order }) {
  154. return this.apiPost(`/question/${type}/start`, { paperId, disorder, order });
  155. }
  156. /**
  157. * 下一题
  158. * @param {*} userReportId
  159. */
  160. next(userReportId) {
  161. return this.apiPost('/question/next', { userReportId });
  162. }
  163. /**
  164. * 提交题目答案
  165. * @param {*} userQuestionId
  166. * @param {*} answer
  167. * @param {*} time
  168. * @param {*} setting
  169. */
  170. submit(userQuestionId, answer, time, setting) {
  171. return this.apiPost('/question/submit', { userQuestionId, answer, time, setting });
  172. }
  173. /**
  174. * 完成考试
  175. * @param {*} userReportId
  176. */
  177. finish(userReportId) {
  178. return this.apiPost('/question/finish', { userReportId });
  179. }
  180. /**
  181. * 继续考试
  182. * @param {*} userReportId
  183. */
  184. continue(userReportId) {
  185. return this.apiPost('/question/continue', { userReportId });
  186. }
  187. /**
  188. * 模考:下一阶段
  189. * @param {*} userPaperId
  190. */
  191. stage(userReportId) {
  192. return this.apiPost('/question/stage', { userReportId });
  193. }
  194. /**
  195. * 重置考试
  196. * @param {*} userPaperId
  197. */
  198. restart(userPaperId) {
  199. return this.apiPost('/question/restart/paper', { userPaperId });
  200. }
  201. /**
  202. * 重置整套模考卷
  203. */
  204. resetCat() {
  205. return this.apiPost('/question/reset/cat');
  206. }
  207. }
  208. export const Question = new QuestionStore({ key: 'question' });