Commit ca1218f3 authored by zhengke's avatar zhengke

1

parent 11103e1f
......@@ -451,7 +451,7 @@
watch: {
'ChooseItem.Title': {
handler(newValue) {
this.ChooseItem.ShowTitle = newValue;
this.ChooseItem.ShowTitle = this.getRegItem(newValue);
},
deep: true
},
......@@ -521,7 +521,7 @@
this.GetPaperInfo()
}
},
methods: {
methods: {
//大类改变分数
changeGroupScore(gItem) {
var subScore = 0;
......@@ -800,9 +800,16 @@
this.ChooseItem.AnswerParse = questionItem.AnswerParse;
this.$forceUpdate();
},
//正则匹配替换
getRegItem(val){
let Item = val.replace(/<iframe(([\s\S])*?)<\/iframe>/ig,'[音频]').replace(/<img.*?(?:>|\/>)/gi,'[图片]');
return Item
},
//保存题目
SavePaper() {
if (this.validateType()) {
console.log('进入');
return;
savePaperInfo(this.DataObj).then(res => {
if (res.Code == 1) {
this.$q.notify({
......@@ -848,10 +855,10 @@
}
}
}
//单选题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'single') {
var Num = 0;
//单选题 多选题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'single'||this.DataObj.GroupList[k].QuestionTypeKey == 'multiple') {
for (let i = 0; i < this.DataObj.GroupList[k].DetailsList.length; i++) {
var Num = 0;
if (this.DataObj.GroupList[k].DetailsList[i].Title == '') {
this.$q.notify({
type: 'negative',
......@@ -875,17 +882,19 @@
Num++
}
}
}
if (Num == 0) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请设置单选题答案选项`
})
result = false;
return;
if (Num == 0) {
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