|
|
@@ -142,7 +142,7 @@
|
|
|
import {
|
|
|
examUserCoursewareLearningRestart,examElLabEduRelationAcademicYearProgress,
|
|
|
examUserExamStudyTaskList,examUserExamStart,examUserPracticeSummary,
|
|
|
- examUserExamCommitmentConfirm,examAttemptFinished,
|
|
|
+ examUserExamCommitmentConfirm,examUserExamAttemptFinished,
|
|
|
} from "@/api/safetyEducationExaminationNew/index";
|
|
|
import richTextPdf from '@/views/safetyEducationExaminationNew/components/richTextPdf.vue';
|
|
|
export default {
|
|
|
@@ -201,28 +201,18 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ //确认考试承诺书
|
|
|
examUserExamCommitmentConfirm(type,attemptId){
|
|
|
examUserExamCommitmentConfirm({attemptId:attemptId}).then(response => {
|
|
|
- if(type == 1){
|
|
|
- this.$router.push({
|
|
|
- path: '/startTheExam',
|
|
|
- query: {
|
|
|
- attemptId: attemptId,
|
|
|
- type: '1',
|
|
|
- examKind:this.preData.examKind,
|
|
|
- }
|
|
|
- })
|
|
|
- }else if(type == 2){
|
|
|
- this.$router.push({
|
|
|
- path: '/startTheExam',
|
|
|
- query: {
|
|
|
- examId: this.preData.examId,
|
|
|
- attemptId: attemptId,
|
|
|
- type: '1',
|
|
|
- examKind:this.preData.examKind,
|
|
|
- }
|
|
|
- })
|
|
|
+ let obj = {
|
|
|
+ examId: this.preData.examId,
|
|
|
+ attemptId: attemptId,
|
|
|
+ type: '1',
|
|
|
+ examKind:this.preData.examKind,
|
|
|
+ attemptLimit:this.preData.attemptLimit,
|
|
|
+ attemptCount:this.preData.attemptCount,
|
|
|
}
|
|
|
+ this.examUserExamAttemptFinished(1,obj);
|
|
|
})
|
|
|
},
|
|
|
//开始考试判断是否有承诺书
|
|
|
@@ -234,30 +224,9 @@ export default {
|
|
|
this.$set(this,'preExamDialogType',true);
|
|
|
}else{
|
|
|
if(item.attemptId){
|
|
|
- this.$router.push({
|
|
|
- path: '/startTheExam',
|
|
|
- query: {
|
|
|
- attemptId: item.attemptId,
|
|
|
- type: '1',
|
|
|
- examKind:item.examKind,
|
|
|
- }
|
|
|
- })
|
|
|
+ this.examUserExamAttemptFinished(1,item);
|
|
|
}else{
|
|
|
- examUserExamStart({examId:item.examId,examScene:1,}).then(response => {
|
|
|
- if(response.data.attemptId){
|
|
|
- this.$router.push({
|
|
|
- path: '/startTheExam',
|
|
|
- query: {
|
|
|
- examId: item.examId,
|
|
|
- attemptId: response.data.attemptId,
|
|
|
- type: '1',
|
|
|
- examKind:item.examKind,
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.msgError(response.message)
|
|
|
- }
|
|
|
- })
|
|
|
+ this.examUserExamStartPlay(1,item);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -309,27 +278,16 @@ export default {
|
|
|
}else if(type == 3){
|
|
|
//模拟考试
|
|
|
if(item.mockExamId){
|
|
|
- this.$router.push({
|
|
|
- path: '/mockExam',
|
|
|
- query: {
|
|
|
- examId: item.examId,
|
|
|
- attemptId: item.mockExamId,
|
|
|
- }
|
|
|
- })
|
|
|
+ let obj = {
|
|
|
+ examId: item.examId,
|
|
|
+ attemptId: item.mockExamId,
|
|
|
+ };
|
|
|
+ this.examUserExamAttemptFinished(2,obj);
|
|
|
}else{
|
|
|
- examUserExamStart({examId:item.examId,examScene:2,}).then(response => {
|
|
|
- if(response.data.attemptId){
|
|
|
- this.$router.push({
|
|
|
- path: '/mockExam',
|
|
|
- query: {
|
|
|
- examId: item.examId,
|
|
|
- attemptId: response.data.attemptId,
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.msgError(response.message)
|
|
|
- }
|
|
|
- })
|
|
|
+ let obj = {
|
|
|
+ examId: item.examId,
|
|
|
+ };
|
|
|
+ this.examUserExamStartPlay(2,obj);
|
|
|
}
|
|
|
}else if(type == 4){
|
|
|
//在线考试//补考
|
|
|
@@ -377,27 +335,16 @@ export default {
|
|
|
}else if(type == 3){
|
|
|
//模拟考试
|
|
|
if(item.mockExamId){
|
|
|
- this.$router.push({
|
|
|
- path: '/mockExam',
|
|
|
- query: {
|
|
|
- examId: item.examId,
|
|
|
- attemptId: item.mockExamId,
|
|
|
- }
|
|
|
- })
|
|
|
+ let obj = {
|
|
|
+ examId: item.examId,
|
|
|
+ attemptId: item.mockExamId,
|
|
|
+ };
|
|
|
+ this.examUserExamAttemptFinished(2,obj);
|
|
|
}else{
|
|
|
- examUserExamStart({examId:item.examId,examScene:2,}).then(response => {
|
|
|
- if(response.data.attemptId){
|
|
|
- this.$router.push({
|
|
|
- path: '/mockExam',
|
|
|
- query: {
|
|
|
- examId: item.examId,
|
|
|
- attemptId: response.data.attemptId,
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.msgError(response.message)
|
|
|
- }
|
|
|
- })
|
|
|
+ let obj = {
|
|
|
+ examId: item.examId,
|
|
|
+ };
|
|
|
+ this.examUserExamStartPlay(2,obj);
|
|
|
}
|
|
|
}else if(type == 4){
|
|
|
//在线考试//补考
|
|
|
@@ -405,38 +352,46 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//二次验证考试是否已结束
|
|
|
- examAttemptFinished(type,item){
|
|
|
- examAttemptFinished({attemptId:item.attemptId}).then(response => {
|
|
|
+ examUserExamAttemptFinished(type,item){
|
|
|
+ examUserExamAttemptFinished({attemptId:item.attemptId}).then(response => {
|
|
|
if(response.data){
|
|
|
- //已完成
|
|
|
- if(item.attemptLimit ==0||item.attemptCount<item.attemptLimit){
|
|
|
- //获取新试卷
|
|
|
- if(type == 1){
|
|
|
- //在线考试
|
|
|
- examUserExamStart({examId:item.examId,examScene:1,}).then(response => {
|
|
|
- if(response.data.attemptId){
|
|
|
- this.$router.push({
|
|
|
- path: '/startTheExam',
|
|
|
- query: {
|
|
|
- examId: item.examId,
|
|
|
- attemptId: response.data.attemptId,
|
|
|
- type: '1',
|
|
|
- examKind:item.examKind,
|
|
|
- }
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.msgError(response.message)
|
|
|
- }
|
|
|
- })
|
|
|
+ //已结束
|
|
|
+ if(type == 1){
|
|
|
+ //在线考试
|
|
|
+ if(item.attemptLimit == 0 || item.attemptCount < item.attemptLimit){
|
|
|
+ //获取新试卷
|
|
|
+ this.examUserExamStartPlay(type,item)
|
|
|
}else{
|
|
|
- //模拟考试
|
|
|
-
|
|
|
+ //无可用次数 提示并刷新数据列表
|
|
|
+ this.msgError('当前考试已结束')
|
|
|
+ this.examUserExamStudyTaskList();
|
|
|
+ this.examUserExamStudyTaskList2();
|
|
|
}
|
|
|
- }else{
|
|
|
- //无可用次数 提示并刷新数据列表
|
|
|
+ }else if(type == 2){
|
|
|
+ //模拟考试-获取新试卷
|
|
|
+ this.examUserExamStartPlay(type,item)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //未结束
|
|
|
+ this.confirmTitle(type,item);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取考试试卷
|
|
|
+ examUserExamStartPlay(type,item){
|
|
|
+ examUserExamStart({examId:item.examId,examScene:type,}).then(response => {
|
|
|
+ if(response.data.attemptId){
|
|
|
+ let obj = {
|
|
|
+ examId: item.examId,
|
|
|
+ attemptId: response.data.attemptId,
|
|
|
+ };
|
|
|
+ if(type == 1){
|
|
|
+ obj.type = 1;
|
|
|
+ obj.examKind = item.examKind;
|
|
|
}
|
|
|
+ this.confirmTitle(type,obj);
|
|
|
}else{
|
|
|
- //未完成
|
|
|
+ this.msgError(response.message)
|
|
|
}
|
|
|
})
|
|
|
},
|