mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-20 08:16:44 +08:00
考试试题提交前增加校验
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user