123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import BaseStore from '@src/stores/base';
- export default class ExerciseStore extends BaseStore {
- courseStruct() {
- return this.allStruct().then((result) => {
- return result.filter(row => row.isCourse);
- });
- }
- dataStruct() {
- return this.allStruct().then((result) => {
- return result.filter(row => row.isData);
- });
- }
- allStruct() {
- return this.apiGet('/exercise/struct/all');
- }
- addStruct(params) {
- return this.apiPost('/exercise/struct/add', params);
- }
- editStruct(params) {
- return this.apiPut('/exercise/struct/edit', params);
- }
- delStruct(params) {
- return this.apiDel('/exercise/struct/delete', params);
- }
- listPaper(params) {
- return this.apiGet('/exercise/paper/list', params);
- }
- listQuestion(params) {
- return this.apiGet('/exercise/question/list', params);
- }
- auto() {
- return this.apiPost('/exercise/paper/auto');
- }
- }
- export const Exercise = new ExerciseStore({ key: 'exercise' });
|