Commit 666286f2 authored by zhengke's avatar zhengke

修改

parent 4fc5a1b9
...@@ -309,7 +309,7 @@ ...@@ -309,7 +309,7 @@
</div> </div>
<div class="row wrap" v-if="ChooseItem" style="padding:20px;"> <div class="row wrap" v-if="ChooseItem" style="padding:20px;">
<div class="edit_stem"> <div class="edit_stem">
<q-input filled stack-label maxlength="5" :dense="false" v-model="ChooseItem.Score" class="col-12 q-pb-lg" <q-input filled stack-label maxlength="5" :dense="false" @keyup.native="checkInteger(ChooseItem,'Score')" v-model="ChooseItem.Score" class="col-12 q-pb-lg"
label="分数" /> label="分数" />
</div> </div>
<div class="col-12"> <div class="col-12">
...@@ -463,6 +463,12 @@ ...@@ -463,6 +463,12 @@
this.calcPaper(); this.calcPaper();
}, },
deep: true deep: true
},
'ChooseItem.QuestionContentObj':{
handler(newValue) {
this.ChooseItem.QuestionContentObj = newValue;
},
deep: true
} }
}, },
data() { data() {
...@@ -623,6 +629,7 @@ ...@@ -623,6 +629,7 @@
}, },
//题型点击【添加问题】 //题型点击【添加问题】
onItemClick(item, index) { onItemClick(item, index) {
console.log(item,'item');
var questionObj = this.getDetailsObj(); var questionObj = this.getDetailsObj();
questionObj.QuestionTypeId = item.QId; questionObj.QuestionTypeId = item.QId;
questionObj.QuestionTypeKey = item.Key; questionObj.QuestionTypeKey = item.Key;
...@@ -771,13 +778,15 @@ ...@@ -771,13 +778,15 @@
ClickItem(questionItem, index, index2) { ClickItem(questionItem, index, index2) {
this.ComOneIndex = index; this.ComOneIndex = index;
this.ComCheckIndex = index2; this.ComCheckIndex = index2;
this.ChooseItem = questionItem; this.ChooseItem = JSON.parse(JSON.stringify(questionItem));
console.log(this.ChooseItem,'choose');
        this.$refs.UE_Title.reloadNewValue();         this.$refs.UE_Title.reloadNewValue();
console.log(this.ChooseItem,'choose')
this.$forceUpdate(); this.$forceUpdate();
}, },
//保存题目 //保存题目
SavePaper() { SavePaper() {
console.log(this.DataObj,'data');
// return
if(this.validateType()){ if(this.validateType()){
savePaperInfo(this.DataObj).then(res => { savePaperInfo(this.DataObj).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
...@@ -815,7 +824,7 @@ ...@@ -815,7 +824,7 @@
this.$q.notify({ this.$q.notify({
type: 'negative', type: 'negative',
position: "top", position: "top",
message: `第一组第${p+1}行数据内容为空!` message: `${this.DataObj.GroupList[k].GroupName}${j+1}第一组第${p+1}行数据内容为空!`
}) })
result = false; result = false;
return; return;
...@@ -824,6 +833,44 @@ ...@@ -824,6 +833,44 @@
} }
} }
} }
//单选题
if (this.DataObj.GroupList[k].QuestionTypeKey == 'single'){
var Num=0;
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(this.DataObj.GroupList[k].DetailsList[i].QuestionContentObj[j].IsAnswer){
Num++
}
}
}
if(Num==0){
this.$q.notify({
type: 'negative',
position: "top",
message: `请设置单选题答案选项`
})
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