|
|
@@ -99,7 +99,7 @@ import { getOpenExaminee, getPaper, commitExamineePaper } from '@/api/modules/st
|
|
|
import { useExam } from '@/composables/useExam';
|
|
|
import { Study } from '@/types';
|
|
|
import { NEXT_QUESTION, PREV_QUESTION, NEXT_QUESTION_QUICKLY, PREV_QUESTION_QUICKLY } from '@/types/injectionSymbols';
|
|
|
-import { ExamPaper, ExamPaperSubmit } from '@/types/study';
|
|
|
+import { Examinee, ExamPaper, ExamPaperSubmit } from '@/types/study';
|
|
|
const { prevData, transferBack } = useTransferPage();
|
|
|
const { setQuestionList, questionList, stateQuestionList, questionTypeDesc, favoriteList, notKnowList, markList, currentIndex,
|
|
|
totalCount, doneCount, notDoneCount, notKnowCount, markCount,
|
|
|
@@ -116,6 +116,7 @@ const isAnimationFinish = ref(false);
|
|
|
const transitionStartX = ref(null);
|
|
|
const transitionEndX = ref(null);
|
|
|
const isReady = ref(false);
|
|
|
+const examineerData = ref<Examinee>({} as Examinee);
|
|
|
const paperData = ref<ExamPaper>({} as ExamPaper);
|
|
|
const pageTitle = computed(() => {
|
|
|
const { mode } = prevData.value;
|
|
|
@@ -136,47 +137,26 @@ const handleLeftClick = () => {
|
|
|
beforeQuit();
|
|
|
};
|
|
|
const handleSwiperChange = (e: any) => {
|
|
|
- console.log(e)
|
|
|
+ // console.log(e)
|
|
|
currentIndex.value = e.detail.current;
|
|
|
};
|
|
|
const beforeQuit = () => {
|
|
|
const { mode } = prevData.value;
|
|
|
- if (mode === EnumExamMode.PRACTICE) {
|
|
|
- beforeQuitPractice();
|
|
|
- } else {
|
|
|
- beforeQuitExam();
|
|
|
- }
|
|
|
-};
|
|
|
-const beforeQuitPractice = () => {
|
|
|
- uni.$ie.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '当前练习未完成,确认退出?',
|
|
|
- }).then(confirm => {
|
|
|
- if (confirm) {
|
|
|
- uni.$ie.showLoading('保存中...');
|
|
|
- setTimeout(() => {
|
|
|
- uni.$ie.hideLoading();
|
|
|
- uni.navigateBack();
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
- });
|
|
|
-};
|
|
|
-const beforeQuitExam = () => {
|
|
|
if (!isReady.value) {
|
|
|
return;
|
|
|
}
|
|
|
+ const msg = mode === EnumExamMode.PRACTICE ? '当前练习未完成,确认退出?' : '当前考试未完成,确认退出?';
|
|
|
uni.$ie.showModal({
|
|
|
title: '提示',
|
|
|
- content: '当前考试未完成,确认退出?',
|
|
|
+ content: msg,
|
|
|
}).then(confirm => {
|
|
|
if (confirm) {
|
|
|
handleSubmit();
|
|
|
- // uni.navigateBack();
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
const currentQuestion = computed(() => {
|
|
|
- console.log(questionList.value[currentIndex.value])
|
|
|
+ // console.log(questionList.value[currentIndex.value])
|
|
|
return questionList.value[currentIndex.value] || {};
|
|
|
});
|
|
|
const hanadleNavigate = (index: number) => {
|
|
|
@@ -185,11 +165,11 @@ const hanadleNavigate = (index: number) => {
|
|
|
changeIndex(index);
|
|
|
}
|
|
|
const handleFavorite = () => {
|
|
|
- console.log('handleFavorite')
|
|
|
+ // console.log('handleFavorite')
|
|
|
currentQuestion.value.isFavorite = !currentQuestion.value.isFavorite;
|
|
|
};
|
|
|
const handleMark = () => {
|
|
|
- console.log('handleMark')
|
|
|
+ // console.log('handleMark')
|
|
|
currentQuestion.value.isMark = !currentQuestion.value.isMark;
|
|
|
};
|
|
|
const questionStatsPopupRef = ref();
|
|
|
@@ -283,6 +263,7 @@ const handleSubmit = () => {
|
|
|
const params = {
|
|
|
...paperData.value,
|
|
|
questions: questionList.value,
|
|
|
+ examineeId: examineerData.value.examineeId,
|
|
|
} as ExamPaperSubmit;
|
|
|
if (!isExamMode.value) {
|
|
|
params.duration = practiceDuration.value;
|
|
|
@@ -305,6 +286,7 @@ const loadData = async () => {
|
|
|
transferBack();
|
|
|
return;
|
|
|
}
|
|
|
+ examineerData.value = data;
|
|
|
if (data.paperId) {
|
|
|
const res = await getPaper({
|
|
|
type: prevData.value.paperType,
|