|
|
@@ -142,7 +142,7 @@
|
|
|
import {
|
|
|
examUserCoursewareLearningRestart,examElLabEduRelationAcademicYearProgress,
|
|
|
examUserExamStudyTaskList,examUserExamStart,examUserPracticeSummary,
|
|
|
- examUserExamCommitmentConfirm,
|
|
|
+ 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,33 +335,95 @@ 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){
|
|
|
//在线考试//补考
|
|
|
this.setRichExamData(item);
|
|
|
}
|
|
|
},
|
|
|
+ //二次验证考试是否已结束
|
|
|
+ examUserExamAttemptFinished(type,item){
|
|
|
+ examUserExamAttemptFinished({attemptId:item.attemptId}).then(response => {
|
|
|
+ if(response.data){
|
|
|
+ //已结束
|
|
|
+ if(type == 1){
|
|
|
+ //在线考试
|
|
|
+ if(item.attemptLimit == 0 || item.attemptCount < item.attemptLimit){
|
|
|
+ //获取新试卷
|
|
|
+ this.examUserExamStartPlay(type,item)
|
|
|
+ }else{
|
|
|
+ //无可用次数 提示并刷新数据列表
|
|
|
+ this.msgError('当前考试已结束')
|
|
|
+ this.examUserExamStudyTaskList();
|
|
|
+ this.examUserExamStudyTaskList2();
|
|
|
+ }
|
|
|
+ }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)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //提示与跳转
|
|
|
+ confirmTitle(type,obj){
|
|
|
+ let self = this;
|
|
|
+ if(type == 1){
|
|
|
+ this.$confirm(
|
|
|
+ '考试期间未完成答题请勿离开页面,离开后倒计时仍会继续,超时将自动交卷并记录成绩,扣除 1 次考试机会。',
|
|
|
+ '进入考试页面',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定进入',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ closeOnClickModal: false,
|
|
|
+ closeOnPressEscape: false
|
|
|
+ }
|
|
|
+ ).then(() => {
|
|
|
+ //在线考试
|
|
|
+ this.$router.push({
|
|
|
+ path: '/startTheExam',
|
|
|
+ query: obj
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ }else if(type == 2){
|
|
|
+ //模拟考试
|
|
|
+ self.$router.push({
|
|
|
+ path: '/mockExam',
|
|
|
+ query: obj
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
//查询学年进度列表
|
|
|
examElLabEduRelationAcademicYearProgress(){
|
|
|
examElLabEduRelationAcademicYearProgress({}).then(response => {
|