123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- import BaseStore from '@src/stores/base';
- export default class QuestionStore extends BaseStore {
- startLink(type, item) {
- linkTo(`/paper/process/${type}/${item.id}`);
- }
- continueLink(type, item) {
- linkTo(`/paper/process/${type}/${item.id}?r=${item.report.id}`);
- }
- reportLink(item) {
- linkTo(`/paper/report/${item.report.id}`);
- }
- /**
- * 练习进度
- * @param {*} structId
- */
- getExerciseProgress(structId) {
- return this.apiGet('/question/exercise/progress', { structId });
- }
- /**
- * 查询第4层考点信息
- * @param {*} structId
- */
- getExercisePlace(structId) {
- return this.apiGet('/question/exercise/place', { structId });
- }
- /**
- * 练习组卷
- * @param {*} page
- * @param {*} size
- * @param {*} structId
- * @param {*} logic
- * @param {*} logicExtend
- * @param {*} finish: true完成,false未完成
- */
- getExerciseList({ page, size, structId, logic, logicExtend, finish }) {
- return this.apiGet('/question/exercise/list', { page, size, structId, logic, logicExtend, times: finish ? 1 : null });
- }
- /**
- * 模考进度
- * @param {*} page
- * @param {*} size
- */
- getExaminationProgress(page, size) {
- return this.apiGet('/question/examination/progress', { page, size });
- }
- /**
- * 模考组卷
- * @param {*} page
- * @param {*} size
- */
- getExaminationList(page, size) {
- return this.apiGet('/question/examination/list', { page, size });
- }
- /**
- * 通过题目Id获取详情
- * @param {*} userQuestionId
- */
- getDetailById(userQuestionId) {
- return this.apiGet('/question/detail', { userQuestionId });
- }
- /**
- * 通过记录及序号获取基础信息
- * @param {*} userReportId
- * @param {*} no
- */
- getDetailByNo(userReportId, no) {
- return this.apiGet('/question/base', { userReportId, no });
- }
- /**
- * 获取练习卷
- * @param {*} paperId
- */
- getExercisePaper(paperId) {
- return this.apiGet('/question/exercise/paper', { paperId });
- }
- /**
- * 获取模考卷
- * @param {*} paperId
- */
- getExaminationPaper(paperId) {
- return this.apiGet('/question/examination/paper', { paperId });
- }
- /**
- * 获取错题组卷
- * @param {*} paperId
- */
- getErrorPaper(paperId) {
- return this.apiGet('/question/error/paper', { paperId });
- }
- /**
- * 获取收藏组卷
- * @param {*} paperId
- */
- getCollectPaper(paperId) {
- return this.apiGet('/quesiton/collect/paper', { paperId });
- }
- /**
- * 获取组卷
- * @param {*} type
- * @param {*} paperId
- */
- getPaper(type, paperId) {
- return this.apiGet(`/question/${type}/paper`, { paperId });
- }
- /**
- * 获取做题记录
- * @param {*} userReportId
- */
- baseReport(userReportId) {
- return this.apiGet('/question/report/base', { userReportId });
- }
- /**
- * 获取做题详细记录
- * @param {*} userReportId
- */
- detailReport(userReportId) {
- return this.apiGet('/question/report/detail', { userReportId });
- }
- /**
- * 开始考试
- * @param {*} type
- * @param {*} paperId
- * @param {*} disorder
- * @param {*} order: 模考
- */
- start(type, paperId, { disorder, order }) {
- return this.apiPost(`/question/${type}/start`, { paperId, disorder, order });
- }
- /**
- * 下一题
- * @param {*} userReportId
- */
- next(userReportId) {
- return this.apiPost('/question/next', { userReportId });
- }
- /**
- * 提交题目答案
- * @param {*} userQuestionId
- * @param {*} answer
- * @param {*} time
- * @param {*} setting
- */
- submit(userQuestionId, answer, time, setting) {
- return this.apiPost('/question/submit', { userQuestionId, answer, time, setting });
- }
- /**
- * 完成考试
- * @param {*} userReportId
- */
- finish(userReportId) {
- return this.apiPost('/question/finish', { userReportId });
- }
- /**
- * 继续考试
- * @param {*} userReportId
- */
- continue(userReportId) {
- return this.apiPost('/question/continue', { userReportId });
- }
- /**
- * 模考:下一阶段
- * @param {*} userPaperId
- */
- stage(userReportId) {
- return this.apiPost('/question/stage', { userReportId });
- }
- /**
- * 重置考试
- * @param {*} userPaperId
- */
- restart(userPaperId) {
- return this.apiPost('/question/restart/paper', { userPaperId });
- }
- /**
- * 重置整套模考卷
- * @param {*} structId
- */
- restartExamination(structId) {
- return this.apiPost('/question/restart/examination', { structId });
- }
- }
- export const Question = new QuestionStore({ key: 'question' });
|