考试试题提交前增加校验

This commit is contained in:
daihh
2023-01-11 17:14:31 +08:00
parent 72b1262254
commit 50079559e2
2 changed files with 54 additions and 4 deletions

View File

@@ -573,13 +573,13 @@ export default {
return this.$message.warning('请您完善基本信息必填项!')
}
//检查是否都有分数了
//检查是否有重复的试卷
let qidMap=new Map();
let hasItem=null;
let allScore=true;
this.paper.data.some(qitem=>{
if(!qitem.score){
if(!qitem.defaultScore || qitem.defaultScore=='0'){
allScore=false;
return true;
}
@@ -591,12 +591,12 @@ export default {
return false;
}
});
if(!allScore){
this.$message.error('有试题未设置分数');
return;
}
if(hasItem!=null){
console.log(hasItem);
this.$message.error('选择的试题重复:'+hasItem.title)