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