1
0

question.js 5.5 KB

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