提交修改

This commit is contained in:
daihh
2022-08-12 16:34:20 +08:00
parent 65f7bd6df9
commit e49969d587
3 changed files with 33 additions and 4 deletions

View File

@@ -31,9 +31,20 @@ const getLast = function(examId){
return ajax.get('/xboe/m/exam/alone/user/last?testId='+examId);
}
/**
* 检查试卷是否已经使用并推送了,
* 返回true 代表已推送,就不能再编辑试卷的试题了,如果返回 false 代表未推送,可以编辑试卷试题
* @param paperId
*/
const checkPaper = function(paperId){
return ajax.post('/xboe/m/exam/task/check-paper',{paperId});
}
export default {
pushExecute,
myList,
getLast
getLast,
checkPaper
}

View File

@@ -562,6 +562,7 @@ export default {
}
if(this.multiple.length > 0){
this.multiple.forEach(item => {
//提取正确答案
let tempAnswer=[];
item.optionList.forEach(opt=>{
if(opt.isAnswer){
@@ -578,7 +579,10 @@ export default {
}
let str1=item.userAnswer.join();
let str2=tempAnswer.join();
if(str1==str2){
console.log('str1='+str1);
console.log('str2='+str2);
total+=item.defaultScore;
}
});

View File

@@ -174,7 +174,7 @@
<div v-if="item.type < 900">
<div style="display: flex;justify-content: space-between;background-color: #dcf1ff;padding: 5px;">
<div>
<span style="padding-right: 5px;"><el-checkbox v-model="item.checked" @change="checkedChange"></el-checkbox></span>
<span style="padding-right: 5px;" v-if="paperQEdit"><el-checkbox v-model="item.checked" @change="checkedChange"></el-checkbox></span>
<span v-if="item.type == 1">单选题</span>
<span v-if="item.type == 2">多选题</span>
<span v-if="item.type == 3">判断题</span>
@@ -185,7 +185,7 @@
<el-input @input="changeInput($event)" v-model="item.defaultScore" style="width: 120px;" size="mini" placeholder="分数" @blur="paperCalculation()">
<template slot="append"></template>
</el-input>
<el-button icon="el-icon-delete" @click="checkDelete(idx)" size="mini"></el-button>
<el-button v-if="paperQEdit" icon="el-icon-delete" @click="checkDelete(idx)" size="mini"></el-button>
</div>
</div>
<div style="padding: 15px;">
@@ -203,7 +203,9 @@
</div>
</div>
</div>
</div>
<div style="padding-top: 5px;color: #ab0000; "> 如果试卷在考试中已使用并有推送了就不能再删除试卷中的试题了</div>
</el-col>
</el-row>
</el-tab-pane>
@@ -278,6 +280,7 @@
<script>
import apiPaper from '@/api/modules/paper.js';
import apiExamTask from '@/api/modules/examTask.js';
import examQuestionApi from "@/api/modules/question";
import { deepClone } from '../../utils';
import {numberToLetter, deepCopy} from '../../utils/tools.js';
@@ -364,6 +367,7 @@ export default {
]
},
showAddDialog: false,
paperQEdit:true,
paper: {
testName: '',
remark: '',
@@ -455,6 +459,7 @@ export default {
},
addPaper(){
this.showAddDialog = true;
this.paperQEdit=true;
this.paper = {};
this.paper.data = [];
this.resOwner = [];
@@ -649,6 +654,7 @@ export default {
eidtVolume(row) {
this.isEidt = true;
this.showAddDialog = true;
this.paperQEdit=true;
this.paper = {};
this.resOwner = [];
this.formTab = 'info';
@@ -668,7 +674,15 @@ export default {
} else {
this.$message.error(res.message);
}
})
});
//检查是否可编辑试题
apiExamTask.checkPaper(row.id).then(rs=>{
if(rs.status==200){
this.paperQEdit=!rs.result;
}else{
//不进行提示了
}
});
},
changeTab(tab) {
//判断,如果,如果没有试卷的id 就不能切换到试卷编辑页,要提示先保存