|
@@ -87,8 +87,10 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</question-stats-popup>
|
|
</question-stats-popup>
|
|
|
- <question-correct-popup ref="questionCorrectPopupRef" />
|
|
|
|
|
- <fast-guide v-model:show="guideShow" :list="guideList" v-model:index="guideIndex"></fast-guide>
|
|
|
|
|
|
|
+ <question-correct-popup ref="questionCorrectPopupRef" @close="handleCorrectClose" />
|
|
|
|
|
+ <fast-guide v-model:show="guideShow" :list="guideList" v-model:index="guideIndex"
|
|
|
|
|
+ @close="handleGuideClose"></fast-guide>
|
|
|
|
|
+ <question-swiper-tip :visible="showSwiperTip" @next="handleSwiperTipNext" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
@@ -96,46 +98,49 @@ import QuestionWrap from './components/question-wrap.vue';
|
|
|
import QuestionStatsPopup from './components/question-stats-popup.vue';
|
|
import QuestionStatsPopup from './components/question-stats-popup.vue';
|
|
|
import QuestionProgress from './components/question-progress.vue';
|
|
import QuestionProgress from './components/question-progress.vue';
|
|
|
import QuestionCorrectPopup from './components/question-correct-popup.vue';
|
|
import QuestionCorrectPopup from './components/question-correct-popup.vue';
|
|
|
|
|
+import QuestionSwiperTip from './components/question-swiper-tip.vue';
|
|
|
import { useTransferPage } from '@/hooks/useTransferPage';
|
|
import { useTransferPage } from '@/hooks/useTransferPage';
|
|
|
|
|
+import { useUserStore } from '@/store/userStore';
|
|
|
import { EnumPaperType } from '@/common/enum';
|
|
import { EnumPaperType } from '@/common/enum';
|
|
|
import { getOpenExaminee, getPaper, commitExamineePaper, collectQuestion, cancelCollectQuestion, beginExaminee } from '@/api/modules/study';
|
|
import { getOpenExaminee, getPaper, commitExamineePaper, collectQuestion, cancelCollectQuestion, beginExaminee } from '@/api/modules/study';
|
|
|
import { useExam } from '@/composables/useExam';
|
|
import { useExam } from '@/composables/useExam';
|
|
|
import { Study } from '@/types';
|
|
import { Study } from '@/types';
|
|
|
import { NEXT_QUESTION, PREV_QUESTION, NEXT_QUESTION_QUICKLY, PREV_QUESTION_QUICKLY } from '@/types/injectionSymbols';
|
|
import { NEXT_QUESTION, PREV_QUESTION, NEXT_QUESTION_QUICKLY, PREV_QUESTION_QUICKLY } from '@/types/injectionSymbols';
|
|
|
import { number } from 'echarts';
|
|
import { number } from 'echarts';
|
|
|
|
|
+const userStore = useUserStore();
|
|
|
// import { Examinee, ExamPaper, ExamPaperSubmit } from '@/types/study';
|
|
// import { Examinee, ExamPaper, ExamPaperSubmit } from '@/types/study';
|
|
|
const { prevData, transferBack } = useTransferPage();
|
|
const { prevData, transferBack } = useTransferPage();
|
|
|
-const { setQuestionList, questionList, groupedQuestionList, stateQuestionList, questionTypeDesc, favoriteList, notKnowList, markList, currentIndex,
|
|
|
|
|
- totalCount, doneCount, notDoneCount, notKnowCount, markCount, isAllDone, nextQuestion, prevQuestion, nextQuestionQuickly, prevQuestionQuickly, swiperDuration,
|
|
|
|
|
- formatPracticeDuration, formatExamDuration, practiceDuration, startPracticeDuration, stopPracticeDuration,
|
|
|
|
|
- examDuration, startExamDuration, stopExamDuration, setExamDuration, setCountDownCallback, changeIndex, setDuration, reset } = useExam();
|
|
|
|
|
|
|
+const { setQuestionList, questionList, groupedQuestionList, questionTypeDesc, currentIndex,
|
|
|
|
|
+ totalCount, doneCount, notDoneCount, isAllDone, nextQuestion, prevQuestion, nextQuestionQuickly, prevQuestionQuickly, swiperDuration,
|
|
|
|
|
+ formatPracticeDuration, practiceDuration, startPracticeDuration, stopPracticeDuration, changeIndex, setDuration, reset } = useExam();
|
|
|
|
|
|
|
|
provide(NEXT_QUESTION, nextQuestion);
|
|
provide(NEXT_QUESTION, nextQuestion);
|
|
|
provide(PREV_QUESTION, prevQuestion);
|
|
provide(PREV_QUESTION, prevQuestion);
|
|
|
provide(NEXT_QUESTION_QUICKLY, nextQuestionQuickly);
|
|
provide(NEXT_QUESTION_QUICKLY, nextQuestionQuickly);
|
|
|
provide(PREV_QUESTION_QUICKLY, prevQuestionQuickly);
|
|
provide(PREV_QUESTION_QUICKLY, prevQuestionQuickly);
|
|
|
//
|
|
//
|
|
|
|
|
+const showSwiperTip = ref(false);
|
|
|
const guideShow = ref(false);
|
|
const guideShow = ref(false);
|
|
|
const guideList = ref([
|
|
const guideList = ref([
|
|
|
{
|
|
{
|
|
|
target: '#question-correct-btn',
|
|
target: '#question-correct-btn',
|
|
|
position: 'top',
|
|
position: 'top',
|
|
|
- msg: '这是第一步'
|
|
|
|
|
|
|
+ msg: '[题目纠错]\n点击题目纠错,帮助我们改进题目'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
target: '#question-favorite-btn',
|
|
target: '#question-favorite-btn',
|
|
|
position: 'top',
|
|
position: 'top',
|
|
|
- msg: '这是第二步'
|
|
|
|
|
|
|
+ msg: '[题目收藏]\n收藏的题目可以在收藏夹查看'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
target: '#question-mark-btn',
|
|
target: '#question-mark-btn',
|
|
|
position: 'top',
|
|
position: 'top',
|
|
|
- msg: '这是第三步'
|
|
|
|
|
|
|
+ msg: '[题目标记]\n标记的题目可以在答题卡中快速找到'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
target: '#question-calendar-btn',
|
|
target: '#question-calendar-btn',
|
|
|
position: 'top',
|
|
position: 'top',
|
|
|
- msg: '这是第四步'
|
|
|
|
|
|
|
+ msg: '[答题卡]\n查看答题卡,掌握考试进度'
|
|
|
}
|
|
}
|
|
|
]);
|
|
]);
|
|
|
const guideIndex = ref(0);
|
|
const guideIndex = ref(0);
|
|
@@ -196,8 +201,12 @@ const hanadleNavigate = (index: number) => {
|
|
|
/// 问题纠错
|
|
/// 问题纠错
|
|
|
const questionCorrectPopupRef = ref();
|
|
const questionCorrectPopupRef = ref();
|
|
|
const handleCorrect = () => {
|
|
const handleCorrect = () => {
|
|
|
|
|
+ stopTime();
|
|
|
questionCorrectPopupRef.value.open(currentQuestion.value.id);
|
|
questionCorrectPopupRef.value.open(currentQuestion.value.id);
|
|
|
}
|
|
}
|
|
|
|
|
+const handleCorrectClose = () => {
|
|
|
|
|
+ startTime();
|
|
|
|
|
+}
|
|
|
const handleFavorite = async () => {
|
|
const handleFavorite = async () => {
|
|
|
if (!currentQuestion.value.isFavorite) {
|
|
if (!currentQuestion.value.isFavorite) {
|
|
|
await collectQuestion(currentQuestion.value.id);
|
|
await collectQuestion(currentQuestion.value.id);
|
|
@@ -268,6 +277,9 @@ const beforeSubmit = () => {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 重新作答
|
|
|
|
|
+ */
|
|
|
const handleReset = () => {
|
|
const handleReset = () => {
|
|
|
if (doneCount.value <= 0) {
|
|
if (doneCount.value <= 0) {
|
|
|
return;
|
|
return;
|
|
@@ -286,6 +298,9 @@ const handleReset = () => {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 自动提交
|
|
|
|
|
+ */
|
|
|
const autoSubmit = () => {
|
|
const autoSubmit = () => {
|
|
|
if (isAllDone.value) {
|
|
if (isAllDone.value) {
|
|
|
if (hasShowSubmitConfirm.value) {
|
|
if (hasShowSubmitConfirm.value) {
|
|
@@ -296,6 +311,10 @@ const autoSubmit = () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 提交试卷
|
|
|
|
|
+ * @param tempSave 是否临时保存
|
|
|
|
|
+ */
|
|
|
const handleSubmit = (tempSave: boolean = false) => {
|
|
const handleSubmit = (tempSave: boolean = false) => {
|
|
|
console.log('handleSubmit', questionList.value)
|
|
console.log('handleSubmit', questionList.value)
|
|
|
const msg = tempSave ? '保存中...' : '提交中...';
|
|
const msg = tempSave ? '保存中...' : '提交中...';
|
|
@@ -334,7 +353,6 @@ const restoreQuestion = (savedQuestion: Study.ExamineeQuestion[], fullQuestion:
|
|
|
if (!savedQuestion) {
|
|
if (!savedQuestion) {
|
|
|
return fullQuestion;
|
|
return fullQuestion;
|
|
|
}
|
|
}
|
|
|
- console.log(savedQuestion, fullQuestion)
|
|
|
|
|
for (const item of fullQuestion) {
|
|
for (const item of fullQuestion) {
|
|
|
const savedQs = savedQuestion.find(q => q.id === item.id);
|
|
const savedQs = savedQuestion.find(q => q.id === item.id);
|
|
|
if (savedQs) {
|
|
if (savedQs) {
|
|
@@ -386,19 +404,35 @@ const combinePaperData = async (examinee: Study.Examinee, paperType: EnumPaperTy
|
|
|
type: paperType,
|
|
type: paperType,
|
|
|
id: examinee.paperId
|
|
id: examinee.paperId
|
|
|
});
|
|
});
|
|
|
- console.log('试卷信息', res)
|
|
|
|
|
- uni.$ie.hideLoading();
|
|
|
|
|
paperData.value = res.data;
|
|
paperData.value = res.data;
|
|
|
paperData.value.questions = restoreQuestion(examinee.questions, res.data.questions);
|
|
paperData.value.questions = restoreQuestion(examinee.questions, res.data.questions);
|
|
|
setQuestionList(paperData.value.questions);
|
|
setQuestionList(paperData.value.questions);
|
|
|
setDuration(examinee.duration || 0);
|
|
setDuration(examinee.duration || 0);
|
|
|
|
|
+ await nextTick();
|
|
|
isReady.value = true;
|
|
isReady.value = true;
|
|
|
- startTime();
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- guideShow.value = true;
|
|
|
|
|
- }, 500);
|
|
|
|
|
|
|
+ await nextTick();
|
|
|
|
|
+ console.log('试卷信息', res)
|
|
|
|
|
+ if (!userStore.isExamGuideShow) {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ uni.$ie.hideLoading();
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ showSwiperTip.value = true;
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ }, 300);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ uni.$ie.hideLoading();
|
|
|
|
|
+ startTime();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+const handleSwiperTipNext = () => {
|
|
|
|
|
+ showSwiperTip.value = false;
|
|
|
|
|
+ guideShow.value = true;
|
|
|
|
|
+}
|
|
|
|
|
+const handleGuideClose = () => {
|
|
|
|
|
+ userStore.isExamGuideShow = true;
|
|
|
|
|
+ startTime();
|
|
|
|
|
+}
|
|
|
const loadData = async () => {
|
|
const loadData = async () => {
|
|
|
uni.$ie.showLoading();
|
|
uni.$ie.showLoading();
|
|
|
const { paperType } = prevData.value;
|
|
const { paperType } = prevData.value;
|