import BaseStore from '@src/stores/base'; export default class QuestionStore extends BaseStore { startLink(type, item, open = true) { if (open) { openLink(`/paper/process/${type}/${item.id}`); } else { linkTo(`/paper/process/${type}/${item.id}`); } } continueLink(type, item, open = true) { // const w = window.open('about:blank'); // w.location.href = `/paper/process/${type}/${item.id}?r=${item.report.id}`; if (open) { openLink(`/paper/process/${type}/${item.id}?r=${item.report.id}`); } else { linkTo(`/paper/process/${type}/${item.id}?r=${item.report.id}`); } } reportLink(item, open = true) { // const w = window.open('about:blank'); // w.location.href = `/paper/report/${item.report.id}`; if (open) { openLink(`/paper/report/${item.report.id}`); } else { linkTo(`/paper/report/${item.report.id}`); } } reportPrevLink(item, open = true) { if (open) { openLink(`/paper/report/${item.prevReport.id}`); } else { linkTo(`/paper/report/${item.prevReport.id}`); } } searchStem({ keyword, questionTypes, module, structIds, place, difficult, order, page, size }) { return this.apiGet('/question/search/stem', { keyword, questionTypes, module, structIds, place, difficult, order, page, size }); } searchNo({ keyword, page, size }) { return this.apiGet('/question/search/no', { page, size, keyword }); } /** * 通过题目Id获取详情 * @param {*} questionNoId */ getInfoById(questionNoId) { return this.apiGet('/question/info', { questionNoId }); } /** * 练习进度 * @param {*} structId */ getExerciseProgress(structId) { return this.apiGet('/question/exercise/progress', { structId }); } /** * 查询第4层考点信息 * @param {*} structId */ getExercisePlace(structId) { return this.apiGet('/question/exercise/place', { structId }); } /** * 获取模考信息:cat */ getExaminationInfo() { return this.apiGet('/question/examination/info'); } /** * 模考进度 * @param {*} structId */ getExaminationProgress(structId) { return this.apiGet('/question/examination/progress', { 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 }); } /** * 模考组卷 * @param {*} page * @param {*} size */ getExaminationList({ page, size, structId, finish }) { return this.apiGet('/question/examination/list', { page, size, structId, times: finish }); } /** * 通过题目Id获取详情 * @param {*} userQuestionId */ getDetailById(userQuestionId) { return this.apiGet('/question/detail', { userQuestionId }); } /** * 通过记录及序号获取基础信息 * @param {*} userReportId * @param {*} no * @param {*} stage */ getDetailByNo(userReportId, no, stage) { return this.apiGet('/question/base', { userReportId, no, stage }); } /** * 获取练习卷 * @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 {*} userReportId */ questionReport(userReportId) { return this.apiGet('/question/report/question', { 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 }); } /** * 重置整套模考卷 */ resetCat() { return this.apiPost('/question/reset/cat'); } } export const Question = new QuestionStore({ key: 'question' });