|
@@ -24,8 +24,8 @@
|
|
|
<block v-for="(item, index) in questionList" :key="item.id">
|
|
<block v-for="(item, index) in questionList" :key="item.id">
|
|
|
<swiper-item class="h-full" v-show="Math.abs(currentIndex - index) <= 2">
|
|
<swiper-item class="h-full" v-show="Math.abs(currentIndex - index) <= 2">
|
|
|
<question-wrap :question="item" :currentIndex="currentIndex" :index="index"
|
|
<question-wrap :question="item" :currentIndex="currentIndex" :index="index"
|
|
|
- :subQuestionIndex="subQuestionIndex" :readonly="isReadOnly" @update:question="handleUpdateQuestion"
|
|
|
|
|
- @changeSubQuestion="handleChangeSubQuestion" />
|
|
|
|
|
|
|
+ :subQuestionIndex="subQuestionIndex" :readonly="isReadOnly"
|
|
|
|
|
+ @changeSubQuestion="handleChangeSubQuestion" @change-question="handleChangeQuestion" />
|
|
|
</swiper-item>
|
|
</swiper-item>
|
|
|
</block>
|
|
</block>
|
|
|
</swiper>
|
|
</swiper>
|
|
@@ -57,7 +57,7 @@
|
|
|
<view class="ml-20">
|
|
<view class="ml-20">
|
|
|
<text class="text-30 text-primary">{{ doneCount }}</text>
|
|
<text class="text-30 text-primary">{{ doneCount }}</text>
|
|
|
<text>/</text>
|
|
<text>/</text>
|
|
|
- <text class="text-30 text-fore-light">{{ totalCount }}</text>
|
|
|
|
|
|
|
+ <text class="text-30 text-fore-light">{{ virtualTotalCount }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
<view class="popup-content">
|
|
<view class="popup-content">
|
|
@@ -115,11 +115,11 @@ import QuestionCorrectPopup from './components/question-correct-popup.vue';
|
|
|
import QuestionSwiperTip from './components/question-swiper-tip.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 { useUserStore } from '@/store/userStore';
|
|
|
-import { EnumPaperType } from '@/common/enum';
|
|
|
|
|
|
|
+import { EnumPaperType, EnumQuestionType } from '@/common/enum';
|
|
|
import { getOpenExaminee, getPaper, commitExamineePaper, collectQuestion, cancelCollectQuestion, beginExaminee, getExamineeResult } from '@/api/modules/study';
|
|
import { getOpenExaminee, getPaper, commitExamineePaper, collectQuestion, cancelCollectQuestion, beginExaminee, getExamineeResult } 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, SHOW_SUBMIT_CONFIRM, IS_ALL_DONE } from '@/types/injectionSymbols';
|
|
|
|
|
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
// import { Examinee, ExamPaper, ExamPaperSubmit } from '@/types/study';
|
|
// import { Examinee, ExamPaper, ExamPaperSubmit } from '@/types/study';
|
|
@@ -130,10 +130,6 @@ const { setQuestionList, questionList, groupedQuestionList, questionTypeDesc,
|
|
|
notDoneCount, isAllDone, nextQuestion, prevQuestion, nextQuestionQuickly, prevQuestionQuickly, swiperDuration,
|
|
notDoneCount, isAllDone, nextQuestion, prevQuestion, nextQuestionQuickly, prevQuestionQuickly, swiperDuration,
|
|
|
formatPracticeDuration, practiceDuration, startPracticeDuration, stopPracticeDuration, changeIndex, setDuration, reset } = useExam();
|
|
formatPracticeDuration, practiceDuration, startPracticeDuration, stopPracticeDuration, changeIndex, setDuration, reset } = useExam();
|
|
|
|
|
|
|
|
-provide(NEXT_QUESTION, nextQuestion);
|
|
|
|
|
-provide(PREV_QUESTION, prevQuestion);
|
|
|
|
|
-provide(NEXT_QUESTION_QUICKLY, nextQuestionQuickly);
|
|
|
|
|
-provide(PREV_QUESTION_QUICKLY, prevQuestionQuickly);
|
|
|
|
|
//
|
|
//
|
|
|
const showSwiperTip = ref(false);
|
|
const showSwiperTip = ref(false);
|
|
|
const guideShow = ref(false);
|
|
const guideShow = ref(false);
|
|
@@ -172,6 +168,13 @@ const hasShowSubmitConfirm = ref(false);
|
|
|
const examineeId = ref<number | undefined>(undefined);
|
|
const examineeId = ref<number | undefined>(undefined);
|
|
|
// const examineerData = ref<Study.Examinee>({} as Study.Examinee);
|
|
// const examineerData = ref<Study.Examinee>({} as Study.Examinee);
|
|
|
const paperData = ref<Study.ExamPaper>({} as Study.ExamPaper);
|
|
const paperData = ref<Study.ExamPaper>({} as Study.ExamPaper);
|
|
|
|
|
+
|
|
|
|
|
+provide(NEXT_QUESTION, nextQuestion);
|
|
|
|
|
+provide(PREV_QUESTION, prevQuestion);
|
|
|
|
|
+provide(NEXT_QUESTION_QUICKLY, nextQuestionQuickly);
|
|
|
|
|
+provide(PREV_QUESTION_QUICKLY, prevQuestionQuickly);
|
|
|
|
|
+provide(IS_ALL_DONE, isAllDone);
|
|
|
|
|
+
|
|
|
const pageTitle = computed(() => {
|
|
const pageTitle = computed(() => {
|
|
|
if (isReadOnly.value) {
|
|
if (isReadOnly.value) {
|
|
|
return '考试解析';
|
|
return '考试解析';
|
|
@@ -364,7 +367,14 @@ const handleSubmit = (tempSave: boolean = false) => {
|
|
|
questions: questionList.value.map(item => {
|
|
questions: questionList.value.map(item => {
|
|
|
return {
|
|
return {
|
|
|
...item,
|
|
...item,
|
|
|
- isDone: tempSave ? item.isDone : true
|
|
|
|
|
|
|
+ title: '',
|
|
|
|
|
+ isDone: tempSave ? item.isDone : true,
|
|
|
|
|
+ subQuestions: item.subQuestions.map(subItem => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ ...subItem,
|
|
|
|
|
+ title: '',
|
|
|
|
|
+ };
|
|
|
|
|
+ })
|
|
|
};
|
|
};
|
|
|
}),
|
|
}),
|
|
|
examineeId: examineeId.value,
|
|
examineeId: examineeId.value,
|
|
@@ -372,6 +382,7 @@ const handleSubmit = (tempSave: boolean = false) => {
|
|
|
isDone: tempSave ? isAllDone.value : true,
|
|
isDone: tempSave ? isAllDone.value : true,
|
|
|
duration: practiceDuration.value
|
|
duration: practiceDuration.value
|
|
|
} as Study.ExamPaperSubmit;
|
|
} as Study.ExamPaperSubmit;
|
|
|
|
|
+ console.log(params, 123)
|
|
|
commitExamineePaper(params);
|
|
commitExamineePaper(params);
|
|
|
setTimeout(async () => {
|
|
setTimeout(async () => {
|
|
|
uni.$ie.hideLoading();
|
|
uni.$ie.hideLoading();
|
|
@@ -381,15 +392,28 @@ const handleSubmit = (tempSave: boolean = false) => {
|
|
|
}, 1000);
|
|
}, 1000);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const handleUpdateQuestion = (question: Study.Question) => {
|
|
|
|
|
- if (currentIndex.value === questionList.value.length - 1) {
|
|
|
|
|
- autoSubmit();
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
const handleChangeSubQuestion = (index: number) => {
|
|
const handleChangeSubQuestion = (index: number) => {
|
|
|
- console.log(index, 123)
|
|
|
|
|
setSubQuestionIndex(index);
|
|
setSubQuestionIndex(index);
|
|
|
}
|
|
}
|
|
|
|
|
+const handleChangeQuestion = (question: Study.Question) => {
|
|
|
|
|
+ if (isAllDone.value && !hasShowSubmitConfirm.value) {
|
|
|
|
|
+ autoSubmit();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 判断是多选还是单选
|
|
|
|
|
+ if (question.typeId === EnumQuestionType.MULTIPLE_CHOICE) {
|
|
|
|
|
+ // 多选题,选择不会时切换下一题,否则不自动切换
|
|
|
|
|
+ if (question.isNotKnow) {
|
|
|
|
|
+ nextQuestion?.();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (question.isDone) {
|
|
|
|
|
+ nextQuestion?.();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
/**
|
|
/**
|
|
|
* 恢复上次做题历史数据
|
|
* 恢复上次做题历史数据
|
|
|
* @param savedQuestion 上次做题历史数据
|
|
* @param savedQuestion 上次做题历史数据
|
|
@@ -416,6 +440,7 @@ const restoreQuestion = (savedQuestion: Study.ExamineeQuestion[], fullQuestion:
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log(fullQuestion, 123)
|
|
|
return fullQuestion;
|
|
return fullQuestion;
|
|
|
}
|
|
}
|
|
|
const loadPracticeData = async () => {
|
|
const loadPracticeData = async () => {
|
|
@@ -449,7 +474,7 @@ const loadSimulationData = async () => {
|
|
|
transferBack();
|
|
transferBack();
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- totalExamTime.value = data.paperInfo.time;
|
|
|
|
|
|
|
+ totalExamTime.value = data.paperInfo?.time || 0;
|
|
|
combinePaperData(data, paperType);
|
|
combinePaperData(data, paperType);
|
|
|
}
|
|
}
|
|
|
const combinePaperData = async (examinee: Study.Examinee, paperType: EnumPaperType) => {
|
|
const combinePaperData = async (examinee: Study.Examinee, paperType: EnumPaperType) => {
|
|
@@ -498,7 +523,7 @@ const loadData = async () => {
|
|
|
const { paperType } = prevData.value;
|
|
const { paperType } = prevData.value;
|
|
|
if (paperType === EnumPaperType.PRACTICE) {
|
|
if (paperType === EnumPaperType.PRACTICE) {
|
|
|
loadPracticeData();
|
|
loadPracticeData();
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else if (paperType === EnumPaperType.SIMULATED) {
|
|
|
loadSimulationData();
|
|
loadSimulationData();
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|