Commit ca1218f3 authored by zhengke's avatar zhengke

1

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