sentence.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import BaseStore from '@src/stores/base';
  2. export default class SentenceStore extends BaseStore {
  3. /**
  4. * 所有长难句信息
  5. */
  6. getInfo() {
  7. return this.apiGet('/sentence/info');
  8. }
  9. /**
  10. * 激活长难句
  11. * @param {*} code
  12. */
  13. active(code) {
  14. return this.apiPut('/sentence/active', { code });
  15. }
  16. /**
  17. * 文章列表
  18. * @param {*} chapter
  19. */
  20. listArticle(chapter) {
  21. return this.apiGet('/sentence/article/list', { chapter });
  22. }
  23. /**
  24. * 更新长难句文章进度
  25. * @param {*} chapter
  26. * @param {*} part
  27. * @param {*} process
  28. */
  29. updateProcess(chapter, part, process) {
  30. return this.apiPut('/sentence/article/process', { chapter, part, process });
  31. }
  32. /**
  33. * 长难句组卷列表
  34. */
  35. listPaper() {
  36. return this.apiGet('/sentence/paper/list');
  37. }
  38. /**
  39. * 获取题目详情
  40. * @param {*} questionNoId
  41. */
  42. detail(questionNoId) {
  43. return this.apiGet('/sentence/question/detail', { questionNoId });
  44. }
  45. /**
  46. * 开始做题
  47. * @param {*} paperId
  48. */
  49. start(paperId) {
  50. return this.apiPost('/sentence/paper/start', { paperId });
  51. }
  52. /**
  53. * 获取下一题
  54. * @param {*} reportId
  55. */
  56. next(reportId) {
  57. return this.apiPost('/sentence/paper/next', { reportId });
  58. }
  59. /**
  60. * 提交题目答案
  61. * @param {*} questionNoId
  62. */
  63. submit(questionNoId) {
  64. return this.apiPost('//sentence/paper/submit', { questionNoId });
  65. }
  66. /**
  67. * 完成考试
  68. * @param {*} paperId
  69. */
  70. finish(paperId) {
  71. return this.apiPost('/qu/sentence/paperstion/finish', { paperId });
  72. }
  73. }
  74. export const Sentence = new SentenceStore({ key: 'sentence' });