Commit 48885fff authored by zhengke's avatar zhengke

修改

parent 709035d4
...@@ -895,46 +895,70 @@ ...@@ -895,46 +895,70 @@
} }
} }
//填空题 //填空题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'fill-in'){
} for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) {
return result; if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
}, this.$q.notify({
//js 判断重复 type: 'negative',
isRepeat(Arr, type) { position: "top",
var result = true; message: `${this.DataObj.GroupList[k].GroupName}${i+1}题标题为空!`
var msg = ''; })
switch (type) { result = false;
case 1: return;
msg = '第1组数据选项不能相同' }
break; for (let j = 0; j < this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj.length; j++) {
case 2: if (this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].Content == '') {
msg = '第2组数据选项不能相同' this.$q.notify({
break; type: 'negative',
case 3: position: "top",
msg = '选项内容不能相同' message: `请填写${this.DataObj.GroupList[k].GroupName}${i+1}空!`
break; })
case 4: result = false;
msg = '题干内容不能相同!'; return;
break; }
default: }
}
let num = 0;
for (var i = 0; i < Arr.length - 1; i++) {
for (var j = i + 1; j < Arr.length; j++) {
if (Arr[i].Content === Arr[j].Content) {
this.$q.notify({
type: 'negative',
position: "top",
message: msg
})
num++;
} }
} }
} //判断题
if (num > 0) { if (this.DataObj.GroupList[k].QuestionTypeKey == 'judge'||this.DataObj.GroupList[k].QuestionTypeKey == 'reading-comprehensio'||
result = false; this.DataObj.GroupList[k].QuestionTypeKey == 'spoken'||this.DataObj.GroupList[k].QuestionTypeKey == 'other'||this.DataObj.GroupList[k].QuestionTypeKey == 'noun-explanation'){
} else { for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) {
result = true; if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `${this.DataObj.GroupList[k].GroupName}${i+1}题标题为空!`
})
result = false;
return;
}
}
}
//简答题 论述题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'short-answer'||this.DataObj.GroupList[k].QuestionTypeKey == 'essay-question'||
this.DataObj.GroupList[k].QuestionTypeKey == 'calculation'||this.DataObj.GroupList[k].QuestionTypeKey == 'entry-problem'){
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) {
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `${this.DataObj.GroupList[k].GroupName}${i+1}题标题为空!`
})
result = false;
return;
}
if(this.DataObj.GroupList[k].DetailsList[i].Answer == ''){
this.$q.notify({
type: 'negative',
position: "top",
message: `请输入${this.DataObj.GroupList[k].GroupName}${i+1}题答案`
})
result = false;
return;
}
}
}
} }
return result; return result;
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment