|
|
@@ -90,9 +90,16 @@ provide(EXAM_PAGE_OPTIONS, prevData.value);
|
|
|
provide(EXAM_DATA, examData);
|
|
|
provide(EXAM_AUTO_SUBMIT, autoSubmit);
|
|
|
|
|
|
-const isExam = computed(() => {
|
|
|
+const isPracticeExam = computed(() => {
|
|
|
+ return prevData.value.paperType === EnumPaperType.PRACTICE || prevData.value.paperType === EnumPaperType.COURSE;
|
|
|
+});
|
|
|
+
|
|
|
+const isSimulationExam = computed(() => {
|
|
|
// prevData.value
|
|
|
- return prevData.value.paperType === EnumPaperType.SIMULATED || prevData.value.paperType === EnumPaperType.TEST;
|
|
|
+ return prevData.value.paperType === EnumPaperType.SIMULATED;
|
|
|
+});
|
|
|
+const isTestExam = computed(() => {
|
|
|
+ return prevData.value.paperType === EnumPaperType.TEST;
|
|
|
});
|
|
|
|
|
|
const isReadOnly = computed(() => {
|
|
|
@@ -139,7 +146,7 @@ const stopTime = () => {
|
|
|
}
|
|
|
|
|
|
|
|
|
-const beforeSubmit = () => {
|
|
|
+const beforeSubmit = async () => {
|
|
|
const text = notDoneCount.value > 0 ? `还有${notDoneCount.value}题未做,确认交卷?` : '是否确认交卷?';
|
|
|
stopTime();
|
|
|
uni.$ie.showModal({
|
|
|
@@ -163,7 +170,7 @@ const handleSubmit = (tempSave: boolean = false) => {
|
|
|
submit();
|
|
|
const msg = tempSave ? '保存中...' : '提交中...';
|
|
|
uni.$ie.showLoading(msg);
|
|
|
- setTimeout(() => {
|
|
|
+ setTimeout(async () => {
|
|
|
const params = {
|
|
|
...paperData.value,
|
|
|
questions: questionList.value.map(item => {
|
|
|
@@ -185,16 +192,17 @@ const handleSubmit = (tempSave: boolean = false) => {
|
|
|
duration: practiceDuration.value
|
|
|
} as Study.ExamPaperSubmit;
|
|
|
console.log('提交试卷参数', params)
|
|
|
- commitExamineePaper(params);
|
|
|
- if (isExam.value) {
|
|
|
+ await commitExamineePaper(params);
|
|
|
+ if (isSimulationExam.value || isTestExam.value) {
|
|
|
if (!tempSave) {
|
|
|
setTimeout(async () => {
|
|
|
uni.$ie.hideLoading();
|
|
|
await nextTick();
|
|
|
transferTo('/pagesStudy/pages/simulation-analysis/simulation-analysis', {
|
|
|
data: {
|
|
|
- examineeId: examineeId.value
|
|
|
- },
|
|
|
+ examineeId: examineeId.value,
|
|
|
+ paperType: prevData.value.paperType
|
|
|
+ } as Transfer.SimulationAnalysisPageOptions,
|
|
|
type: 'redirectTo'
|
|
|
});
|
|
|
}, 2500);
|
|
|
@@ -204,7 +212,7 @@ const handleSubmit = (tempSave: boolean = false) => {
|
|
|
transferBack();
|
|
|
});
|
|
|
}
|
|
|
- } else {
|
|
|
+ } else if (isPracticeExam.value) {
|
|
|
if (!tempSave) {
|
|
|
setTimeout(async () => {
|
|
|
uni.$ie.hideLoading();
|
|
|
@@ -226,7 +234,7 @@ const handleSubmit = (tempSave: boolean = false) => {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- }, 1000);
|
|
|
+ }, 300);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -285,7 +293,7 @@ const loadPracticeData = async () => {
|
|
|
totalExamTime.value = Number.MAX_SAFE_INTEGER;
|
|
|
combinePaperData(data, paperType);
|
|
|
}
|
|
|
-const loadSimulationData = async () => {
|
|
|
+const loadExamData = async () => {
|
|
|
const { paperType, readonly, simulationInfo } = prevData.value;
|
|
|
let data: Study.Examinee;
|
|
|
if (simulationInfo?.examineeId) {
|
|
|
@@ -361,10 +369,10 @@ const handleGuideClose = () => {
|
|
|
const loadData = async () => {
|
|
|
uni.$ie.showLoading();
|
|
|
const { paperType } = prevData.value;
|
|
|
- if (paperType === EnumPaperType.PRACTICE || paperType === EnumPaperType.COURSE || paperType === EnumPaperType.TEST) {
|
|
|
+ if (paperType === EnumPaperType.PRACTICE || paperType === EnumPaperType.COURSE) {
|
|
|
loadPracticeData();
|
|
|
- } else if (paperType === EnumPaperType.SIMULATED) {
|
|
|
- loadSimulationData();
|
|
|
+ } else if (paperType === EnumPaperType.SIMULATED || paperType === EnumPaperType.TEST) {
|
|
|
+ loadExamData();
|
|
|
}
|
|
|
};
|
|
|
onLoad(() => {
|