Commit 48885fff authored by zhengke's avatar zhengke

修改

parent 709035d4
......@@ -895,46 +895,70 @@
}
}
//填空题
}
return result;
},
//js 判断重复
isRepeat(Arr, type) {
var result = true;
var msg = '';
switch (type) {
case 1:
msg = '第1组数据选项不能相同'
break;
case 2:
msg = '第2组数据选项不能相同'
break;
case 3:
msg = '选项内容不能相同'
break;
case 4:
msg = '题干内容不能相同!';
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 (this.DataObj.GroupList[k].QuestionTypeKey == 'fill-in'){
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;
}
for (let j = 0; j < this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj.length; j++) {
if (this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].Content == '') {
this.$q.notify({
type: 'negative',
position: "top",
message: `请填写${this.DataObj.GroupList[k].GroupName}${i+1}空!`
})
result = false;
return;
}
}
}
}
}
if (num > 0) {
result = false;
} else {
result = true;
//判断题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'judge'||this.DataObj.GroupList[k].QuestionTypeKey == 'reading-comprehensio'||
this.DataObj.GroupList[k].QuestionTypeKey == 'spoken'||this.DataObj.GroupList[k].QuestionTypeKey == 'other'||this.DataObj.GroupList[k].QuestionTypeKey == 'noun-explanation'){
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].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;
},
......
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